adding scrollable
This commit is contained in:
parent
40580a6e7a
commit
d2394c6540
|
@ -8,7 +8,7 @@ use cosmic::{
|
|||
theme,
|
||||
widget::{
|
||||
button, container, horizontal_space, icon, mouse_area, row,
|
||||
text, Column, Container, Space,
|
||||
scrollable, text, Column, Container, Space,
|
||||
},
|
||||
Element, Task,
|
||||
};
|
||||
|
@ -162,10 +162,13 @@ impl Library {
|
|||
.on_enter(Message::HoverLibrary(Some(model.kind)))
|
||||
.on_exit(Message::HoverLibrary(None));
|
||||
let lib_container = if self.library_open == Some(model.kind) {
|
||||
let items: Column<Message> = column({
|
||||
let items = scrollable(
|
||||
column({
|
||||
model.items.iter().map(|item| {
|
||||
let text =
|
||||
text::heading(elide_text(item.title(), 18))
|
||||
let text = text::heading(elide_text(
|
||||
item.title(),
|
||||
18,
|
||||
))
|
||||
.center()
|
||||
.wrapping(textm::Wrapping::None);
|
||||
let icon = icon::from_name({
|
||||
|
@ -192,15 +195,20 @@ impl Library {
|
|||
.background(Background::Color(
|
||||
t.cosmic().button.base.into(),
|
||||
))
|
||||
.border(Border::default().rounded(
|
||||
t.cosmic().corner_radii.radius_l,
|
||||
))
|
||||
.border(
|
||||
Border::default().rounded(
|
||||
t.cosmic()
|
||||
.corner_radii
|
||||
.radius_l,
|
||||
),
|
||||
)
|
||||
})
|
||||
.into()
|
||||
})
|
||||
})
|
||||
.spacing(2)
|
||||
.width(Length::Fill);
|
||||
.width(Length::Fill),
|
||||
);
|
||||
Container::new(items).padding(5).style(|t| {
|
||||
container::Style::default()
|
||||
.background(Background::Color(
|
||||
|
|
Loading…
Reference in a new issue