mirror of
https://github.com/librekeys/picoforge.git
synced 2026-07-28 08:01:19 -07:00
ui tweaks for macOS
This commit is contained in:
+1
-1
@@ -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.
|
||||
|
||||
@@ -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
@@ -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.))
|
||||
|
||||
Reference in New Issue
Block a user