fix: cosmic_container tag method
This commit is contained in:
parent
77b8718706
commit
ba90e52848
2 changed files with 14 additions and 8 deletions
|
|
@ -1,11 +1,11 @@
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
use cosmic::{
|
use cosmic::{
|
||||||
app::{command::message::cosmic, Core},
|
app::Core,
|
||||||
iced::{self, event, window},
|
iced::{self, event, window},
|
||||||
iced_core::{id, Alignment, Length, Point},
|
iced_core::{id, Alignment, Length, Point},
|
||||||
iced_widget::{column, scrollable, text, text_input},
|
iced_widget::{column, container, scrollable, text, text_input},
|
||||||
widget::{button, container, cosmic_container},
|
widget::{button, cosmic_container},
|
||||||
Command,
|
Command,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -132,12 +132,14 @@ impl cosmic::Application for MultiWindow {
|
||||||
|
|
||||||
let new_window_button = button(text("New Window")).on_press(Message::NewWindow);
|
let new_window_button = button(text("New Window")).on_press(Message::NewWindow);
|
||||||
|
|
||||||
let content = column![input, new_window_button]
|
let content = scrollable(
|
||||||
.spacing(50)
|
column![input, new_window_button]
|
||||||
.width(Length::Fill)
|
.spacing(50)
|
||||||
.align_items(Alignment::Center);
|
.width(Length::Fill)
|
||||||
|
.align_items(Alignment::Center),
|
||||||
|
);
|
||||||
|
|
||||||
cosmic_container::container(container(content).width(200).center_x())
|
container(container(content).width(200).center_x())
|
||||||
.style(cosmic::style::Container::Background)
|
.style(cosmic::style::Container::Background)
|
||||||
.width(Length::Fill)
|
.width(Length::Fill)
|
||||||
.height(Length::Fill)
|
.height(Length::Fill)
|
||||||
|
|
|
||||||
|
|
@ -140,6 +140,10 @@ where
|
||||||
self.container.children()
|
self.container.children()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn tag(&self) -> iced_core::widget::tree::Tag {
|
||||||
|
self.container.tag()
|
||||||
|
}
|
||||||
|
|
||||||
fn diff(&mut self, tree: &mut Tree) {
|
fn diff(&mut self, tree: &mut Tree) {
|
||||||
self.container.diff(tree);
|
self.container.diff(tree);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue