aboutsummaryrefslogtreecommitdiff
path: root/examples/styling.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/styling.rs')
-rw-r--r--examples/styling.rs14
1 files changed, 12 insertions, 2 deletions
diff --git a/examples/styling.rs b/examples/styling.rs
index 2a45321..cff0b77 100644
--- a/examples/styling.rs
+++ b/examples/styling.rs
@@ -12,13 +12,12 @@ use iced_material::{
type Element<'a, Message> = iced::Element<'a, Message, Theme>;
pub fn main() -> iced::Result {
- iced::application(Styling::default, Styling::update, Styling::view)
+ iced::application(Styling::new, Styling::update, Styling::view)
.subscription(Styling::subscription)
.theme(Styling::theme)
.run()
}
-#[derive(Default)]
struct Styling {
theme: Theme,
system_theme: bool,
@@ -42,6 +41,17 @@ enum Message {
}
impl Styling {
+ fn new() -> Self {
+ Self {
+ theme: Theme::Dark,
+ system_theme: false,
+ input_value: String::new(),
+ slider_value: 0.0,
+ checkbox_value: false,
+ toggler_value: false,
+ }
+ }
+
fn update(&mut self, message: Message) {
match message {
Message::ThemeChanged(theme) => {