From 177da97a1546c1feadf27f1ddd81924ad0c766f5 Mon Sep 17 00:00:00 2001 From: Jackson Goode Date: Mon, 17 Jun 2024 15:18:54 -0400 Subject: [PATCH] Fix macOS preferences window contols and icon from side-panel --- psst-gui/src/ui/mod.rs | 10 ---------- psst-gui/src/ui/preferences.rs | 8 +++++++- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/psst-gui/src/ui/mod.rs b/psst-gui/src/ui/mod.rs index c9237e26..80143b7e 100644 --- a/psst-gui/src/ui/mod.rs +++ b/psst-gui/src/ui/mod.rs @@ -114,7 +114,6 @@ fn root_widget() -> impl Widget { let playlists = Flex::column() .must_fill_main_axis(true) - .with_child(sidebar_logo_widget()) .with_child(sidebar_menu_widget()) .with_default_spacer() .with_flex_child(playlists, 1.0) @@ -269,15 +268,6 @@ fn route_widget() -> impl Widget { .expand() } -fn sidebar_logo_widget() -> impl Widget { - icons::LOGO - .scale((29.0, 32.0)) - .with_color(theme::GREY_500) - .padding((0.0, theme::grid(2.0), 0.0, theme::grid(1.0))) - .center() - .lens(Unit) -} - fn sidebar_menu_widget() -> impl Widget { Flex::column() .with_default_spacer() diff --git a/psst-gui/src/ui/preferences.rs b/psst-gui/src/ui/preferences.rs index 1192db92..2175f4f7 100644 --- a/psst-gui/src/ui/preferences.rs +++ b/psst-gui/src/ui/preferences.rs @@ -7,7 +7,7 @@ use druid::{ Button, Controller, CrossAxisAlignment, Flex, Label, LineBreaking, MainAxisAlignment, RadioGroup, SizedBox, Slider, TextBox, ViewSwitcher, }, - Color, Data, Env, Event, EventCtx, LensExt, LifeCycle, LifeCycleCtx, Selector, Widget, + Color, Data, Env, Event, EventCtx, Insets, LensExt, LifeCycle, LifeCycleCtx, Selector, Widget, WidgetExt, }; use psst_core::connection::Credentials; @@ -95,6 +95,12 @@ pub fn preferences_widget() -> impl Widget { .scroll() .vertical() .content_must_fill(true) + .padding(if cfg!(target_os = "macos") { + // Accommodate the window controls on Mac. + Insets::new(0.0, 24.0, 0.0, 0.0) + } else { + Insets::ZERO + }) } fn tabs_widget() -> impl Widget {