From 54a9a232f8110364972a8eef966b7b7477573f4f Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Mon, 18 Oct 2021 14:48:33 +0700 Subject: Draw scrollbar in `Widget::draw` for `Scrollable` --- examples/styling/src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'examples/styling') diff --git a/examples/styling/src/main.rs b/examples/styling/src/main.rs index 81d33ad3..1746d7b4 100644 --- a/examples/styling/src/main.rs +++ b/examples/styling/src/main.rs @@ -98,7 +98,7 @@ impl Sandbox for Styling { let scrollable = Scrollable::new(&mut self.scroll) .width(Length::Fill) .height(Length::Units(100)) - .style(self.theme) + .style(self.theme.into()) .push(Text::new("Scroll me!")) .push(Space::with_height(Length::Units(800))) .push(Text::new("You did it!")); @@ -212,11 +212,11 @@ mod style { } } - impl From for Box { + impl From for &'static dyn scrollable::StyleSheet { fn from(theme: Theme) -> Self { match theme { Theme::Light => Default::default(), - Theme::Dark => dark::Scrollable.into(), + Theme::Dark => &dark::Scrollable, } } } -- cgit From d61cb58d92b6fcd520f665deb093f3747ffd5e5c Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Mon, 18 Oct 2021 15:36:32 +0700 Subject: Wire up `container` styling to `iced_native` --- examples/styling/src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'examples/styling') diff --git a/examples/styling/src/main.rs b/examples/styling/src/main.rs index 1746d7b4..d8254dd9 100644 --- a/examples/styling/src/main.rs +++ b/examples/styling/src/main.rs @@ -149,7 +149,7 @@ impl Sandbox for Styling { .height(Length::Fill) .center_x() .center_y() - .style(self.theme) + .style(self.theme.into()) .into() } } @@ -176,11 +176,11 @@ mod style { } } - impl From for Box { + impl From for &'static dyn container::StyleSheet { fn from(theme: Theme) -> Self { match theme { Theme::Light => Default::default(), - Theme::Dark => dark::Container.into(), + Theme::Dark => &dark::Container, } } } -- cgit From 3140cdc4babcefc444f1c1d30eb0f5f4ed1df054 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Mon, 18 Oct 2021 16:02:30 +0700 Subject: Wire up styling to `Button` in `iced_native` --- examples/styling/src/main.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'examples/styling') diff --git a/examples/styling/src/main.rs b/examples/styling/src/main.rs index d8254dd9..38ab0411 100644 --- a/examples/styling/src/main.rs +++ b/examples/styling/src/main.rs @@ -82,7 +82,7 @@ impl Sandbox for Styling { let button = Button::new(&mut self.button, Text::new("Submit")) .padding(10) .on_press(Message::ButtonPressed) - .style(self.theme); + .style(self.theme.into()); let slider = Slider::new( &mut self.slider, @@ -203,11 +203,11 @@ mod style { } } - impl From for Box { + impl From for &'static dyn button::StyleSheet { fn from(theme: Theme) -> Self { match theme { - Theme::Light => light::Button.into(), - Theme::Dark => dark::Button.into(), + Theme::Light => &light::Button, + Theme::Dark => &dark::Button, } } } -- cgit From 11bcb1342796a6fabc7c5b89a15c22c754b014ce Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 20 Oct 2021 15:50:42 +0700 Subject: Wire up styling to `Slider` in `iced_native` --- examples/styling/src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'examples/styling') diff --git a/examples/styling/src/main.rs b/examples/styling/src/main.rs index 38ab0411..34d18fc9 100644 --- a/examples/styling/src/main.rs +++ b/examples/styling/src/main.rs @@ -90,7 +90,7 @@ impl Sandbox for Styling { self.slider_value, Message::SliderChanged, ) - .style(self.theme); + .style(self.theme.into()); let progress_bar = ProgressBar::new(0.0..=100.0, self.slider_value).style(self.theme); @@ -221,11 +221,11 @@ mod style { } } - impl From for Box { + impl From for &'static dyn slider::StyleSheet { fn from(theme: Theme) -> Self { match theme { Theme::Light => Default::default(), - Theme::Dark => dark::Slider.into(), + Theme::Dark => &dark::Slider, } } } -- cgit From e914888f57394e4b67b40e42f1ad9df4ae8147e6 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 20 Oct 2021 18:40:39 +0700 Subject: Implement `Widget::draw` for `TextInput` --- examples/styling/src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'examples/styling') diff --git a/examples/styling/src/main.rs b/examples/styling/src/main.rs index 34d18fc9..cca94c8f 100644 --- a/examples/styling/src/main.rs +++ b/examples/styling/src/main.rs @@ -77,7 +77,7 @@ impl Sandbox for Styling { ) .padding(10) .size(20) - .style(self.theme); + .style(self.theme.into()); let button = Button::new(&mut self.button, Text::new("Submit")) .padding(10) @@ -194,11 +194,11 @@ mod style { } } - impl From for Box { + impl From for &'static dyn text_input::StyleSheet { fn from(theme: Theme) -> Self { match theme { Theme::Light => Default::default(), - Theme::Dark => dark::TextInput.into(), + Theme::Dark => &dark::TextInput, } } } -- cgit From d39ad717ed0ab85acbe935d7ab883166b36e7bc7 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 20 Oct 2021 19:06:53 +0700 Subject: Wire up styling to `Radio` in `iced_native` --- examples/styling/src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'examples/styling') diff --git a/examples/styling/src/main.rs b/examples/styling/src/main.rs index cca94c8f..7e9b01ab 100644 --- a/examples/styling/src/main.rs +++ b/examples/styling/src/main.rs @@ -64,7 +64,7 @@ impl Sandbox for Styling { Some(self.theme), Message::ThemeChanged, ) - .style(self.theme), + .style(self.theme.into()), ) }, ); @@ -185,11 +185,11 @@ mod style { } } - impl From for Box { + impl From for &'static dyn radio::StyleSheet { fn from(theme: Theme) -> Self { match theme { Theme::Light => Default::default(), - Theme::Dark => dark::Radio.into(), + Theme::Dark => &dark::Radio, } } } -- cgit From 7c08c6bd138207b862933ee479752a4f1d18c4f2 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 21 Oct 2021 18:50:27 +0700 Subject: Remove `Renderer` trait for `Checkbox` --- examples/styling/src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'examples/styling') diff --git a/examples/styling/src/main.rs b/examples/styling/src/main.rs index 7e9b01ab..5ce54e23 100644 --- a/examples/styling/src/main.rs +++ b/examples/styling/src/main.rs @@ -108,7 +108,7 @@ impl Sandbox for Styling { "Check me!", Message::CheckboxToggled, ) - .style(self.theme); + .style(self.theme.into()); let toggler = Toggler::new( self.toggler_value, @@ -239,11 +239,11 @@ mod style { } } - impl From for Box { + impl From for &'static dyn checkbox::StyleSheet { fn from(theme: Theme) -> Self { match theme { Theme::Light => Default::default(), - Theme::Dark => dark::Checkbox.into(), + Theme::Dark => &dark::Checkbox, } } } -- cgit From d36ce33a95c277ee8fe45555df17daf21ef02ef8 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sun, 31 Oct 2021 16:53:18 +0700 Subject: Reintroduce `Box` for `style_sheet` in `Button` --- examples/styling/src/main.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'examples/styling') diff --git a/examples/styling/src/main.rs b/examples/styling/src/main.rs index 5ce54e23..9e31c383 100644 --- a/examples/styling/src/main.rs +++ b/examples/styling/src/main.rs @@ -82,7 +82,7 @@ impl Sandbox for Styling { let button = Button::new(&mut self.button, Text::new("Submit")) .padding(10) .on_press(Message::ButtonPressed) - .style(self.theme.into()); + .style(self.theme); let slider = Slider::new( &mut self.slider, @@ -203,11 +203,11 @@ mod style { } } - impl From for &'static dyn button::StyleSheet { + impl<'a> From for Box { fn from(theme: Theme) -> Self { match theme { - Theme::Light => &light::Button, - Theme::Dark => &dark::Button, + Theme::Light => light::Button.into(), + Theme::Dark => dark::Button.into(), } } } -- cgit From fcc282bd76c88f389d510411b0ae73e1a4eaf317 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sun, 31 Oct 2021 16:58:02 +0700 Subject: Reintroduce `Box` for `style_sheet` in `Checkbox` --- examples/styling/src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'examples/styling') diff --git a/examples/styling/src/main.rs b/examples/styling/src/main.rs index 9e31c383..e8829b53 100644 --- a/examples/styling/src/main.rs +++ b/examples/styling/src/main.rs @@ -108,7 +108,7 @@ impl Sandbox for Styling { "Check me!", Message::CheckboxToggled, ) - .style(self.theme.into()); + .style(self.theme); let toggler = Toggler::new( self.toggler_value, @@ -239,11 +239,11 @@ mod style { } } - impl From for &'static dyn checkbox::StyleSheet { + impl<'a> From for Box { fn from(theme: Theme) -> Self { match theme { Theme::Light => Default::default(), - Theme::Dark => &dark::Checkbox, + Theme::Dark => dark::Checkbox.into(), } } } -- cgit From 40a5de581144886571504b762719f057dbb2e871 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sun, 31 Oct 2021 17:02:59 +0700 Subject: Reintroduce `Box` for `style_sheet` in `Container` --- examples/styling/src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'examples/styling') diff --git a/examples/styling/src/main.rs b/examples/styling/src/main.rs index e8829b53..3692ad1e 100644 --- a/examples/styling/src/main.rs +++ b/examples/styling/src/main.rs @@ -149,7 +149,7 @@ impl Sandbox for Styling { .height(Length::Fill) .center_x() .center_y() - .style(self.theme.into()) + .style(self.theme) .into() } } @@ -176,11 +176,11 @@ mod style { } } - impl From for &'static dyn container::StyleSheet { + impl<'a> From for Box { fn from(theme: Theme) -> Self { match theme { Theme::Light => Default::default(), - Theme::Dark => &dark::Container, + Theme::Dark => dark::Container.into(), } } } -- cgit From bd7b086ec1f9d428945f05fb12bda157f9e77dfd Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sun, 31 Oct 2021 17:14:10 +0700 Subject: Reintroduce `Box` for `style_sheet` in `Radio` --- examples/styling/src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'examples/styling') diff --git a/examples/styling/src/main.rs b/examples/styling/src/main.rs index 3692ad1e..73f965d9 100644 --- a/examples/styling/src/main.rs +++ b/examples/styling/src/main.rs @@ -64,7 +64,7 @@ impl Sandbox for Styling { Some(self.theme), Message::ThemeChanged, ) - .style(self.theme.into()), + .style(self.theme), ) }, ); @@ -185,11 +185,11 @@ mod style { } } - impl From for &'static dyn radio::StyleSheet { + impl<'a> From for Box { fn from(theme: Theme) -> Self { match theme { Theme::Light => Default::default(), - Theme::Dark => &dark::Radio, + Theme::Dark => dark::Radio.into(), } } } -- cgit From eed19dcf81334d0849744f1918ba880d5a7acc1c Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sun, 31 Oct 2021 17:39:24 +0700 Subject: Reintroduce `Box` for `style_sheet` in `Scrollable` --- examples/styling/src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'examples/styling') diff --git a/examples/styling/src/main.rs b/examples/styling/src/main.rs index 73f965d9..a0ba2607 100644 --- a/examples/styling/src/main.rs +++ b/examples/styling/src/main.rs @@ -98,7 +98,7 @@ impl Sandbox for Styling { let scrollable = Scrollable::new(&mut self.scroll) .width(Length::Fill) .height(Length::Units(100)) - .style(self.theme.into()) + .style(self.theme) .push(Text::new("Scroll me!")) .push(Space::with_height(Length::Units(800))) .push(Text::new("You did it!")); @@ -212,11 +212,11 @@ mod style { } } - impl From for &'static dyn scrollable::StyleSheet { + impl<'a> From for Box { fn from(theme: Theme) -> Self { match theme { Theme::Light => Default::default(), - Theme::Dark => &dark::Scrollable, + Theme::Dark => dark::Scrollable.into(), } } } -- cgit From 0c76e0307ff7d4450c354812f8a25047f24948b4 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sun, 31 Oct 2021 17:42:43 +0700 Subject: Reintroduce `Box` for `style_sheet` in `Slider` --- examples/styling/src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'examples/styling') diff --git a/examples/styling/src/main.rs b/examples/styling/src/main.rs index a0ba2607..b33e26de 100644 --- a/examples/styling/src/main.rs +++ b/examples/styling/src/main.rs @@ -90,7 +90,7 @@ impl Sandbox for Styling { self.slider_value, Message::SliderChanged, ) - .style(self.theme.into()); + .style(self.theme); let progress_bar = ProgressBar::new(0.0..=100.0, self.slider_value).style(self.theme); @@ -221,11 +221,11 @@ mod style { } } - impl From for &'static dyn slider::StyleSheet { + impl<'a> From for Box { fn from(theme: Theme) -> Self { match theme { Theme::Light => Default::default(), - Theme::Dark => &dark::Slider, + Theme::Dark => dark::Slider.into(), } } } -- cgit From 0d3c9ef7bd3d0a0abecdf8e8b5391e32773ca20e Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sun, 31 Oct 2021 17:45:57 +0700 Subject: Reintroduce `Box` for `style_sheet` in `TextInput` --- examples/styling/src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'examples/styling') diff --git a/examples/styling/src/main.rs b/examples/styling/src/main.rs index b33e26de..262db03e 100644 --- a/examples/styling/src/main.rs +++ b/examples/styling/src/main.rs @@ -77,7 +77,7 @@ impl Sandbox for Styling { ) .padding(10) .size(20) - .style(self.theme.into()); + .style(self.theme); let button = Button::new(&mut self.button, Text::new("Submit")) .padding(10) @@ -194,11 +194,11 @@ mod style { } } - impl From for &'static dyn text_input::StyleSheet { + impl<'a> From for Box { fn from(theme: Theme) -> Self { match theme { Theme::Light => Default::default(), - Theme::Dark => &dark::TextInput, + Theme::Dark => dark::TextInput.into(), } } } -- cgit