diff options
author | 2024-05-23 13:29:45 +0200 | |
---|---|---|
committer | 2024-05-23 13:29:45 +0200 | |
commit | d8ba6b0673a33724a177f3a1ba59705527280142 (patch) | |
tree | 89482c8d1e3a03e00b3a8151abbb81e30ae5898c /examples/component | |
parent | 72ed8bcc8def9956e25f3720a3095fc96bb2eef0 (diff) | |
parent | 468794d918eb06c1dbebb33c32b10017ad335f05 (diff) | |
download | iced-d8ba6b0673a33724a177f3a1ba59705527280142.tar.gz iced-d8ba6b0673a33724a177f3a1ba59705527280142.tar.bz2 iced-d8ba6b0673a33724a177f3a1ba59705527280142.zip |
Merge branch 'master' into feat/text-macro
Diffstat (limited to 'examples/component')
-rw-r--r-- | examples/component/src/main.rs | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/examples/component/src/main.rs b/examples/component/src/main.rs index 43ba3187..5625f12a 100644 --- a/examples/component/src/main.rs +++ b/examples/component/src/main.rs @@ -1,5 +1,5 @@ -use iced::widget::container; -use iced::{Element, Length}; +use iced::widget::center; +use iced::Element; use numeric_input::numeric_input; @@ -27,10 +27,8 @@ impl Component { } fn view(&self) -> Element<Message> { - container(numeric_input(self.value, Message::NumericInputChanged)) + center(numeric_input(self.value, Message::NumericInputChanged)) .padding(20) - .height(Length::Fill) - .center_y() .into() } } @@ -73,10 +71,7 @@ mod numeric_input { impl<Message, Theme> Component<Message, Theme> for NumericInput<Message> where - Theme: text::DefaultStyle - + button::DefaultStyle - + text_input::DefaultStyle - + 'static, + Theme: text::Catalog + button::Catalog + text_input::Catalog + 'static, { type State = (); type Event = Event; @@ -151,10 +146,7 @@ mod numeric_input { impl<'a, Message, Theme> From<NumericInput<Message>> for Element<'a, Message, Theme> where - Theme: text::DefaultStyle - + button::DefaultStyle - + text_input::DefaultStyle - + 'static, + Theme: text::Catalog + button::Catalog + text_input::Catalog + 'static, Message: 'a, { fn from(numeric_input: NumericInput<Message>) -> Self { |