From 5f3d867ad754f55574ebcfa7ec34b927659acf49 Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Wed, 27 Aug 2025 13:06:20 -0500 Subject: [PATCH] move the library to the left --- src/main.rs | 37 +++++++++++++++++++++---------------- src/ui/library.rs | 10 ++++++++-- 2 files changed, 29 insertions(+), 18 deletions(-) diff --git a/src/main.rs b/src/main.rs index dfa0858..1a9eb64 100644 --- a/src/main.rs +++ b/src/main.rs @@ -998,9 +998,6 @@ impl cosmic::Application for App { )) }; - let service_list = - Container::new(self.service_list()).padding(5); - let slide_preview = column![ Space::with_height(Length::Fill), Container::new( @@ -1035,14 +1032,23 @@ impl cosmic::Application for App { ] .spacing(3); + let service_list = Container::new(self.service_list()) + .padding(5) + .width(Length::FillPortion(2)); + let library = if self.library_open { - Container::new(if let Some(library) = &self.library { - library.view().map(Message::Library) - } else { - Space::new(0, 0).into() - }) - .style(nav_bar_style) - .center(Length::FillPortion(2)) + Container::new( + Container::new( + if let Some(library) = &self.library { + library.view().map(Message::Library) + } else { + Space::new(0, 0).into() + }, + ) + .style(nav_bar_style), + ) + .padding(5) + .width(Length::FillPortion(2)) } else { Container::new(horizontal_space().width(0)) }; @@ -1051,6 +1057,7 @@ impl cosmic::Application for App { self.song_editor.view().map(Message::SongEditor); let row = row![ + library, service_list, Container::new( button::icon(icon_left) @@ -1079,7 +1086,6 @@ impl cosmic::Application for App { ) .center_y(Length::Fill) .align_left(Length::FillPortion(1)), - library ] .width(Length::Fill) .height(Length::Fill) @@ -1273,7 +1279,9 @@ where let end_index = self.service.len(); let column = column![ - text::heading("Service List").center().width(280), + text::heading("Service List") + .center() + .width(Length::Fill), iced::widget::horizontal_rule(1), column(list).spacing(10), dnd_destination( @@ -1306,10 +1314,7 @@ where // .height(Length::Fill) .style(nav_bar_style); - if !self.core().is_condensed() { - container = container.max_width(280); - } - container.into() + container.center(Length::FillPortion(2)).into() } } diff --git a/src/ui/library.rs b/src/ui/library.rs index 56b47f6..c83760d 100644 --- a/src/ui/library.rs +++ b/src/ui/library.rs @@ -264,12 +264,18 @@ impl<'a> Library { let presentation_library = self.library_item(&self.presentation_library); let column = column![ + text::heading("Library").center().width(Length::Fill), + cosmic::iced::widget::horizontal_rule(1), song_library, image_library, video_library, presentation_library, - ]; - column.height(Length::Fill).spacing(5).into() + ] + .height(Length::Fill) + .padding(10) + .spacing(10) + .into(); + column } pub fn library_item(