Skip to content

Commit

Permalink
Fix macOS preferences window contols and remove icon from side-panel (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jacksongoode authored Jun 18, 2024
1 parent f9a54a6 commit aff2215
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
10 changes: 0 additions & 10 deletions psst-gui/src/ui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ fn root_widget() -> impl Widget<AppState> {

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)
Expand Down Expand Up @@ -269,15 +268,6 @@ fn route_widget() -> impl Widget<AppState> {
.expand()
}

fn sidebar_logo_widget() -> impl Widget<AppState> {
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<AppState> {
Flex::column()
.with_default_spacer()
Expand Down
8 changes: 7 additions & 1 deletion psst-gui/src/ui/preferences.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -95,6 +95,12 @@ pub fn preferences_widget() -> impl Widget<AppState> {
.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<AppState> {
Expand Down

0 comments on commit aff2215

Please sign in to comment.