diff options
| author | 2022-05-14 01:47:55 +0200 | |
|---|---|---|
| committer | 2022-05-14 01:56:32 +0200 | |
| commit | 664251f3f5c7b76f69a97683af1468094bba887f (patch) | |
| tree | f43a495036ed117ce5dbb479c62652d872a6d273 /examples/pane_grid/src | |
| parent | 5de337f214530faab1d5fe47784afd7006c3f7f0 (diff) | |
| download | iced-664251f3f5c7b76f69a97683af1468094bba887f.tar.gz iced-664251f3f5c7b76f69a97683af1468094bba887f.tar.bz2 iced-664251f3f5c7b76f69a97683af1468094bba887f.zip | |
Draft first-class `Theme` support
RFC: https://github.com/iced-rs/rfcs/pull/6
Diffstat (limited to '')
| -rw-r--r-- | examples/pane_grid/src/main.rs | 84 |
1 files changed, 11 insertions, 73 deletions
diff --git a/examples/pane_grid/src/main.rs b/examples/pane_grid/src/main.rs index 2962ca25..4c955b6a 100644 --- a/examples/pane_grid/src/main.rs +++ b/examples/pane_grid/src/main.rs @@ -4,6 +4,7 @@ use iced::executor; use iced::keyboard; use iced::pane_grid::{self, PaneGrid}; use iced::scrollable::{self, Scrollable}; +use iced::theme::{self, Theme}; use iced::{ Application, Color, Column, Command, Container, Element, Length, Row, Settings, Size, Subscription, Text, @@ -36,6 +37,7 @@ enum Message { impl Application for Example { type Message = Message; + type Theme = Theme; type Executor = executor::Default; type Flags = (); @@ -171,7 +173,7 @@ impl Application for Example { let text = if *is_pinned { "Unpin" } else { "Pin" }; let pin_button = Button::new(pin_button, Text::new(text).size(14)) .on_press(Message::TogglePin(id)) - .style(style::Button::Pin) + .style(theme::Button::Secondary) .padding(3); let title = Row::with_children(vec