summaryrefslogtreecommitdiffstats
path: root/examples/pure/component/src/main.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2022-07-09 02:28:52 +0200
committerLibravatar GitHub <noreply@github.com>2022-07-09 02:28:52 +0200
commite053e25d2ccb17f7a162685a106a8bbd915a873f (patch)
tree5304f3ea2712e8889c7278ec5e57418f484d8f6c /examples/pure/component/src/main.rs
parent66eb6263003c1bbedd1fd14d6b12f172d20a6211 (diff)
parent7105db97a53d90adf429091298f31c90974d8f08 (diff)
downloadiced-e053e25d2ccb17f7a162685a106a8bbd915a873f.tar.gz
iced-e053e25d2ccb17f7a162685a106a8bbd915a873f.tar.bz2
iced-e053e25d2ccb17f7a162685a106a8bbd915a873f.zip
Merge pull request #1362 from iced-rs/theming
Theming
Diffstat (limited to 'examples/pure/component/src/main.rs')
-rw-r--r--examples/pure/component/src/main.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/examples/pure/component/src/main.rs b/examples/pure/component/src/main.rs
index b38d6fca..64935afd 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<Message> {
value: Option<u32>,
@@ -88,6 +89,9 @@ mod numeric_input {
impl<Message, Renderer> Component<Message, Renderer> for NumericInput<Message>
where
Renderer: text::Renderer + 'static,
+ Renderer::Theme: widget::button::StyleSheet
+ + widget::text_input::StyleSheet
+ + widget::text::StyleSheet,
{
type State = ();
type Event = Event;
@@ -158,6 +162,9 @@ mod numeric_input {
where
Message: 'a,
Renderer: 'static + text::Renderer,
+ Renderer::Theme: widget::button::StyleSheet
+ + widget::text_input::StyleSheet
+ + widget::text::StyleSheet,
{
fn from(numeric_input: NumericInput<Message>) -> Self {
pure::component(numeric_input)