adding a toolbar to every library
This commit is contained in:
parent
255984961c
commit
6fa08c1fec
|
@ -5,8 +5,9 @@ use cosmic::{
|
||||||
},
|
},
|
||||||
iced_widget::{column, row as rowm, text as textm},
|
iced_widget::{column, row as rowm, text as textm},
|
||||||
widget::{
|
widget::{
|
||||||
container, horizontal_space, icon, mouse_area, responsive,
|
button, container, horizontal_space, icon, mouse_area,
|
||||||
row, scrollable, text, Container, DndSource, Space, Widget,
|
responsive, row, scrollable, text, text_input, Container,
|
||||||
|
DndSource, Icon, Space, Widget,
|
||||||
},
|
},
|
||||||
Element, Task,
|
Element, Task,
|
||||||
};
|
};
|
||||||
|
@ -330,7 +331,7 @@ impl<'a> Library {
|
||||||
})
|
})
|
||||||
.center_x(Length::Fill)
|
.center_x(Length::Fill)
|
||||||
.center_y(Length::Shrink);
|
.center_y(Length::Shrink);
|
||||||
let button = mouse_area(row_container)
|
let library_button = mouse_area(row_container)
|
||||||
.on_press({
|
.on_press({
|
||||||
if self.library_open == Some(model.kind) {
|
if self.library_open == Some(model.kind) {
|
||||||
Message::OpenLibrary(None)
|
Message::OpenLibrary(None)
|
||||||
|
@ -390,7 +391,15 @@ impl<'a> Library {
|
||||||
.width(Length::Fill),
|
.width(Length::Fill),
|
||||||
)
|
)
|
||||||
.spacing(5);
|
.spacing(5);
|
||||||
Container::new(items).padding(5).style(|t| {
|
|
||||||
|
let library_toolbar = rowm!(
|
||||||
|
text_input("Search...", ""),
|
||||||
|
button::icon(icon::from_name("add"))
|
||||||
|
);
|
||||||
|
let library_column =
|
||||||
|
column![library_toolbar, items].spacing(3);
|
||||||
|
|
||||||
|
Container::new(library_column).padding(5).style(|t| {
|
||||||
container::Style::default()
|
container::Style::default()
|
||||||
.background(Background::Color(
|
.background(Background::Color(
|
||||||
t.cosmic().primary.base.into(),
|
t.cosmic().primary.base.into(),
|
||||||
|
@ -402,7 +411,7 @@ impl<'a> Library {
|
||||||
} else {
|
} else {
|
||||||
Container::new(Space::new(0, 0))
|
Container::new(Space::new(0, 0))
|
||||||
};
|
};
|
||||||
column![button, lib_container].into()
|
column![library_button, lib_container].into()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn single_item<T>(
|
fn single_item<T>(
|
||||||
|
@ -453,7 +462,7 @@ impl<'a> Library {
|
||||||
.spacing(10)
|
.spacing(10)
|
||||||
.align_y(Vertical::Center),
|
.align_y(Vertical::Center),
|
||||||
)
|
)
|
||||||
.padding(5)
|
// .padding(5)
|
||||||
.width(Length::Fill)
|
.width(Length::Fill)
|
||||||
.style(move |t| {
|
.style(move |t| {
|
||||||
container::Style::default()
|
container::Style::default()
|
||||||
|
|
Loading…
Reference in a new issue