ui tweaks for macOS

This commit is contained in:
Fabrice Bellamy
2026-02-21 22:24:16 +01:00
parent b6ea8d4e99
commit f6caf33e34
3 changed files with 29 additions and 28 deletions
+1 -1
View File
@@ -57,7 +57,7 @@ fn main() {
title: Some("PicoForge".into()),
appears_transparent: true,
// TODO: This option needs to be tested and adjusted on macos
traffic_light_position: Some(gpui::point(px(12.0), px(12.0))),
traffic_light_position: Some(gpui::point(px(9.0), px(9.0))),
}),
// Render our own window decorations(shadows and resize attack area) for linux/bsd.
+5 -7
View File
@@ -73,13 +73,11 @@ impl<V: 'static> AppSidebar<V> {
.border_color(border_color)
.w(width)
.child({
let header = h_flex()
.w_full()
.items_center()
.bg(sidebar_bg)
// .border_r_1()
// .border_color(border_color)
.pt_4();
#[cfg(not(target_os = "macos"))]
let header = h_flex().w_full().items_center().bg(sidebar_bg).pt_4();
#[cfg(target_os = "macos")]
let header = h_flex().w_full().items_center().bg(sidebar_bg).pt_8();
let current_width = width;
let t = ((current_width - px(48.)) / (px(255.) - px(48.))).clamp(0.0, 1.0);
+23 -20
View File
@@ -137,26 +137,29 @@ impl Render for ApplicationRoot {
.child(
v_flex()
.size_full()
.child(
TitleBar::new().bg(cx.theme().title_bar).child(
h_flex()
.w_full()
.justify_between()
.bg(cx.theme().title_bar)
.items_center()
.cursor(gpui::CursorStyle::OpenHand)
.child(
Button::new("sidebar_toggle")
.ghost()
.icon(IconName::PanelLeft)
.on_click(cx.listener(|this, _, _, _| {
this.is_sidebar_collapsed =
!this.is_sidebar_collapsed;
}))
.tooltip("Toggle Sidebar"),
),
),
)
.child(TitleBar::new().bg(cx.theme().title_bar).child({
#[cfg(not(target_os = "macos"))]
let container = h_flex();
#[cfg(target_os = "macos")]
let container = h_flex().ml(gpui::px(-72.));
container
.w_full()
.justify_between()
.bg(cx.theme().title_bar)
.items_center()
.cursor(gpui::CursorStyle::OpenHand)
.child(
Button::new("sidebar_toggle")
.ghost()
.icon(IconName::PanelLeft)
.on_click(cx.listener(|this, _, _, _| {
this.is_sidebar_collapsed = !this.is_sidebar_collapsed;
}))
.tooltip("Toggle Sidebar"),
)
}))
.child(
v_flex()
.min_h(px(0.))