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/scrollable/src/main.rs | 2 +- examples/scrollable/src/style.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'examples/scrollable/src') diff --git a/examples/scrollable/src/main.rs b/examples/scrollable/src/main.rs index 3416b83d..272f0ce2 100644 --- a/examples/scrollable/src/main.rs +++ b/examples/scrollable/src/main.rs @@ -95,7 +95,7 @@ impl Sandbox for ScrollableDemo { .on_scroll(move |offset| { Message::Scrolled(i, offset) }) - .style(*theme) + .style(theme.clone().into()) .push(Text::new(variant.title)) .push( Button::new( diff --git a/examples/scrollable/src/style.rs b/examples/scrollable/src/style.rs index ae449141..d955f52d 100644 --- a/examples/scrollable/src/style.rs +++ b/examples/scrollable/src/style.rs @@ -34,11 +34,11 @@ impl From for Box { } } -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/scrollable/src/main.rs | 4 ++-- examples/scrollable/src/style.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'examples/scrollable/src') diff --git a/examples/scrollable/src/main.rs b/examples/scrollable/src/main.rs index 272f0ce2..bc20d428 100644 --- a/examples/scrollable/src/main.rs +++ b/examples/scrollable/src/main.rs @@ -164,7 +164,7 @@ impl Sandbox for ScrollableDemo { Container::new(scrollable) .width(Length::Fill) .height(Length::Fill) - .style(*theme), + .style(theme.clone().into()), ) .push(ProgressBar::new( 0.0..=1.0, @@ -190,7 +190,7 @@ impl Sandbox for ScrollableDemo { .height(Length::Fill) .center_x() .center_y() - .style(self.theme) + .style(self.theme.into()) .into() } } diff --git a/examples/scrollable/src/style.rs b/examples/scrollable/src/style.rs index d955f52d..66f3b9d3 100644 --- a/examples/scrollable/src/style.rs +++ b/examples/scrollable/src/style.rs @@ -16,11 +16,11 @@ impl Default for Theme { } } -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 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/scrollable/src/main.rs | 2 +- examples/scrollable/src/style.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'examples/scrollable/src') diff --git a/examples/scrollable/src/main.rs b/examples/scrollable/src/main.rs index bc20d428..2f1c5676 100644 --- a/examples/scrollable/src/main.rs +++ b/examples/scrollable/src/main.rs @@ -76,7 +76,7 @@ impl Sandbox for ScrollableDemo { Some(*theme), Message::ThemeChanged, ) - .style(*theme), + .style(theme.clone().into()), ) }, ); diff --git a/examples/scrollable/src/style.rs b/examples/scrollable/src/style.rs index 66f3b9d3..d7d64374 100644 --- a/examples/scrollable/src/style.rs +++ b/examples/scrollable/src/style.rs @@ -25,11 +25,11 @@ impl From for &'static dyn container::StyleSheet { } } -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 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/scrollable/src/main.rs | 4 ++-- examples/scrollable/src/style.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'examples/scrollable/src') diff --git a/examples/scrollable/src/main.rs b/examples/scrollable/src/main.rs index 2f1c5676..2eaf197e 100644 --- a/examples/scrollable/src/main.rs +++ b/examples/scrollable/src/main.rs @@ -164,7 +164,7 @@ impl Sandbox for ScrollableDemo { Container::new(scrollable) .width(Length::Fill) .height(Length::Fill) - .style(theme.clone().into()), + .style(*theme), ) .push(ProgressBar::new( 0.0..=1.0, @@ -190,7 +190,7 @@ impl Sandbox for ScrollableDemo { .height(Length::Fill) .center_x() .center_y() - .style(self.theme.into()) + .style(self.theme) .into() } } diff --git a/examples/scrollable/src/style.rs b/examples/scrollable/src/style.rs index d7d64374..068483cb 100644 --- a/examples/scrollable/src/style.rs +++ b/examples/scrollable/src/style.rs @@ -16,11 +16,11 @@ impl Default for Theme { } } -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/scrollable/src/main.rs | 2 +- examples/scrollable/src/style.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'examples/scrollable/src') diff --git a/examples/scrollable/src/main.rs b/examples/scrollable/src/main.rs index 2eaf197e..272f0ce2 100644 --- a/examples/scrollable/src/main.rs +++ b/examples/scrollable/src/main.rs @@ -76,7 +76,7 @@ impl Sandbox for ScrollableDemo { Some(*theme), Message::ThemeChanged, ) - .style(theme.clone().into()), + .style(*theme), ) }, ); diff --git a/examples/scrollable/src/style.rs b/examples/scrollable/src/style.rs index 068483cb..3c8e5234 100644 --- a/examples/scrollable/src/style.rs +++ b/examples/scrollable/src/style.rs @@ -25,11 +25,11 @@ impl<'a> From for Box { } } -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/scrollable/src/main.rs | 2 +- examples/scrollable/src/style.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'examples/scrollable/src') diff --git a/examples/scrollable/src/main.rs b/examples/scrollable/src/main.rs index 272f0ce2..3416b83d 100644 --- a/examples/scrollable/src/main.rs +++ b/examples/scrollable/src/main.rs @@ -95,7 +95,7 @@ impl Sandbox for ScrollableDemo { .on_scroll(move |offset| { Message::Scrolled(i, offset) }) - .style(theme.clone().into()) + .style(*theme) .push(Text::new(variant.title)) .push( Button::new( diff --git a/examples/scrollable/src/style.rs b/examples/scrollable/src/style.rs index 3c8e5234..ec1f13db 100644 --- a/examples/scrollable/src/style.rs +++ b/examples/scrollable/src/style.rs @@ -34,11 +34,11 @@ impl<'a> From for Box { } } -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