move the library to the left
Some checks are pending
/ test (push) Waiting to run

This commit is contained in:
Chris Cochrun 2025-08-27 13:06:20 -05:00
parent aa5e7420f1
commit 5f3d867ad7
2 changed files with 29 additions and 18 deletions

View file

@ -998,9 +998,6 @@ impl cosmic::Application for App {
)) ))
}; };
let service_list =
Container::new(self.service_list()).padding(5);
let slide_preview = column![ let slide_preview = column![
Space::with_height(Length::Fill), Space::with_height(Length::Fill),
Container::new( Container::new(
@ -1035,14 +1032,23 @@ impl cosmic::Application for App {
] ]
.spacing(3); .spacing(3);
let service_list = Container::new(self.service_list())
.padding(5)
.width(Length::FillPortion(2));
let library = if self.library_open { let library = if self.library_open {
Container::new(if let Some(library) = &self.library { Container::new(
library.view().map(Message::Library) Container::new(
} else { if let Some(library) = &self.library {
Space::new(0, 0).into() library.view().map(Message::Library)
}) } else {
.style(nav_bar_style) Space::new(0, 0).into()
.center(Length::FillPortion(2)) },
)
.style(nav_bar_style),
)
.padding(5)
.width(Length::FillPortion(2))
} else { } else {
Container::new(horizontal_space().width(0)) Container::new(horizontal_space().width(0))
}; };
@ -1051,6 +1057,7 @@ impl cosmic::Application for App {
self.song_editor.view().map(Message::SongEditor); self.song_editor.view().map(Message::SongEditor);
let row = row![ let row = row![
library,
service_list, service_list,
Container::new( Container::new(
button::icon(icon_left) button::icon(icon_left)
@ -1079,7 +1086,6 @@ impl cosmic::Application for App {
) )
.center_y(Length::Fill) .center_y(Length::Fill)
.align_left(Length::FillPortion(1)), .align_left(Length::FillPortion(1)),
library
] ]
.width(Length::Fill) .width(Length::Fill)
.height(Length::Fill) .height(Length::Fill)
@ -1273,7 +1279,9 @@ where
let end_index = self.service.len(); let end_index = self.service.len();
let column = column![ let column = column![
text::heading("Service List").center().width(280), text::heading("Service List")
.center()
.width(Length::Fill),
iced::widget::horizontal_rule(1), iced::widget::horizontal_rule(1),
column(list).spacing(10), column(list).spacing(10),
dnd_destination( dnd_destination(
@ -1306,10 +1314,7 @@ where
// .height(Length::Fill) // .height(Length::Fill)
.style(nav_bar_style); .style(nav_bar_style);
if !self.core().is_condensed() { container.center(Length::FillPortion(2)).into()
container = container.max_width(280);
}
container.into()
} }
} }

View file

@ -264,12 +264,18 @@ impl<'a> Library {
let presentation_library = let presentation_library =
self.library_item(&self.presentation_library); self.library_item(&self.presentation_library);
let column = column![ let column = column![
text::heading("Library").center().width(Length::Fill),
cosmic::iced::widget::horizontal_rule(1),
song_library, song_library,
image_library, image_library,
video_library, video_library,
presentation_library, presentation_library,
]; ]
column.height(Length::Fill).spacing(5).into() .height(Length::Fill)
.padding(10)
.spacing(10)
.into();
column
} }
pub fn library_item<T>( pub fn library_item<T>(