From 664251f3f5c7b76f69a97683af1468094bba887f Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sat, 14 May 2022 01:47:55 +0200 Subject: Draft first-class `Theme` support RFC: https://github.com/iced-rs/rfcs/pull/6 --- examples/pure/component/src/main.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'examples/pure/component/src/main.rs') diff --git a/examples/pure/component/src/main.rs b/examples/pure/component/src/main.rs index b38d6fca..2f98f768 100644 --- a/examples/pure/component/src/main.rs +++ b/examples/pure/component/src/main.rs @@ -47,12 +47,13 @@ impl Sandbox for Component { } mod numeric_input { - use iced::pure::{button, row, text, text_input}; use iced_lazy::pure::{self, Component}; use iced_native::alignment::{self, Alignment}; use iced_native::text; + use iced_native::widget; use iced_native::Length; use iced_pure::Element; + use iced_pure::{button, row, text, text_input}; pub struct NumericInput { value: Option, @@ -88,6 +89,9 @@ mod numeric_input { impl Component for NumericInput where Renderer: text::Renderer + 'static, + Renderer::Theme: widget::button::StyleSheet, + ::Variant: + Default + Copy, { type State = (); type Event = Event; @@ -158,6 +162,9 @@ mod numeric_input { where Message: 'a, Renderer: 'static + text::Renderer, + Renderer::Theme: widget::button::StyleSheet, + ::Variant: + Default + Copy, { fn from(numeric_input: NumericInput) -> Self { pure::component(numeric_input) -- cgit From cf0230072c01ea9523f4d98a3656f5c975b3f347 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 26 May 2022 23:07:34 +0200 Subject: Rename `Variant` to `Style` and `Style` to `Appearance` --- examples/pure/component/src/main.rs | 4 ---- 1 file changed, 4 deletions(-) (limited to 'examples/pure/component/src/main.rs') diff --git a/examples/pure/component/src/main.rs b/examples/pure/component/src/main.rs index 2f98f768..2c065231 100644 --- a/examples/pure/component/src/main.rs +++ b/examples/pure/component/src/main.rs @@ -90,8 +90,6 @@ mod numeric_input { where Renderer: text::Renderer + 'static, Renderer::Theme: widget::button::StyleSheet, - ::Variant: - Default + Copy, { type State = (); type Event = Event; @@ -163,8 +161,6 @@ mod numeric_input { Message: 'a, Renderer: 'static + text::Renderer, Renderer::Theme: widget::button::StyleSheet, - ::Variant: - Default + Copy, { fn from(numeric_input: NumericInput) -> Self { pure::component(numeric_input) -- cgit From ce53d3933c860cd958636cce415ac97c04aee746 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Tue, 7 Jun 2022 01:11:35 +0200 Subject: Implement theme styling for `TextInput` --- examples/pure/component/src/main.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'examples/pure/component/src/main.rs') diff --git a/examples/pure/component/src/main.rs b/examples/pure/component/src/main.rs index 2c065231..31592dbf 100644 --- a/examples/pure/component/src/main.rs +++ b/examples/pure/component/src/main.rs @@ -89,7 +89,8 @@ mod numeric_input { impl Component for NumericInput where Renderer: text::Renderer + 'static, - Renderer::Theme: widget::button::StyleSheet, + Renderer::Theme: + widget::button::StyleSheet + widget::text_input::StyleSheet, { type State = (); type Event = Event; @@ -160,7 +161,8 @@ mod numeric_input { where Message: 'a, Renderer: 'static + text::Renderer, - Renderer::Theme: widget::button::StyleSheet, + Renderer::Theme: + widget::button::StyleSheet + widget::text_input::StyleSheet, { fn from(numeric_input: NumericInput) -> Self { pure::component(numeric_input) -- cgit From 1dd1a2f97fc747e15e12b5188dad6c41b0d052ea Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 29 Jun 2022 10:51:01 +0200 Subject: Introduce `StyleSheet` for `Text` widget --- examples/pure/component/src/main.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'examples/pure/component/src/main.rs') diff --git a/examples/pure/component/src/main.rs b/examples/pure/component/src/main.rs index 31592dbf..64935afd 100644 --- a/examples/pure/component/src/main.rs +++ b/examples/pure/component/src/main.rs @@ -89,8 +89,9 @@ mod numeric_input { impl Component for NumericInput where Renderer: text::Renderer + 'static, - Renderer::Theme: - widget::button::StyleSheet + widget::text_input::StyleSheet, + Renderer::Theme: widget::button::StyleSheet + + widget::text_input::StyleSheet + + widget::text::StyleSheet, { type State = (); type Event = Event; @@ -161,8 +162,9 @@ mod numeric_input { where Message: 'a, Renderer: 'static + text::Renderer, - Renderer::Theme: - widget::button::StyleSheet + widget::text_input::StyleSheet, + Renderer::Theme: widget::button::StyleSheet + + widget::text_input::StyleSheet + + widget::text::StyleSheet, { fn from(numeric_input: NumericInput) -> Self { pure::component(numeric_input) -- cgit