From 4130ae4be95ce850263fbc55f490b68a95361d58 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Mon, 4 Mar 2024 19:31:26 +0100 Subject: Simplify theming for `Text` widget --- examples/pane_grid/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples/pane_grid/src/main.rs') diff --git a/examples/pane_grid/src/main.rs b/examples/pane_grid/src/main.rs index 39719420..c4bedccc 100644 --- a/examples/pane_grid/src/main.rs +++ b/examples/pane_grid/src/main.rs @@ -162,7 +162,7 @@ impl Application for Example { let title = row![ pin_button, "Pane", - text(pane.id.to_string()).style(if is_focused { + text(pane.id.to_string()).color(if is_focused { PANE_ID_COLOR_FOCUSED } else { PANE_ID_COLOR_UNFOCUSED -- cgit From f4a4845ddbdced81ae4ff60bfa19f0e602d84709 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Mon, 4 Mar 2024 20:42:37 +0100 Subject: Simplify theming for `Button` widget --- examples/pane_grid/src/main.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'examples/pane_grid/src/main.rs') diff --git a/examples/pane_grid/src/main.rs b/examples/pane_grid/src/main.rs index c4bedccc..2bed5a03 100644 --- a/examples/pane_grid/src/main.rs +++ b/examples/pane_grid/src/main.rs @@ -1,13 +1,13 @@ use iced::alignment::{self, Alignment}; use iced::executor; use iced::keyboard; -use iced::theme::{self, Theme}; use iced::widget::pane_grid::{self, PaneGrid}; use iced::widget::{ button, column, container, responsive, row, scrollable, text, }; use iced::{ Application, Color, Command, Element, Length, Settings, Size, Subscription, + Theme, }; pub fn main() -> iced::Result { @@ -287,10 +287,7 @@ fn view_content<'a>( ) ] .push_maybe(if total_panes > 1 && !is_pinned { - Some( - button("Close", Message::Close(pane)) - .style(theme::Button::Destructive), - ) + Some(button("Close", Message::Close(pane)).style(button::destructive)) } else { None }) @@ -327,7 +324,7 @@ fn view_controls<'a>( Some( button(text(content).size(14)) - .style(theme::Button::Secondary) + .style(button::secondary) .padding(3) .on_press(message), ) @@ -336,7 +333,7 @@ fn view_controls<'a>( }); let close = button(text("Close").size(14)) - .style(theme::Button::Destructive) + .style(button::destructive) .padding(3) .on_press_maybe(if total_panes > 1 && !is_pinned { Some(Message::Close(pane)) -- cgit From 29326215ccf13e1d1e25bf3bf5ada007856bff69 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Tue, 5 Mar 2024 03:48:08 +0100 Subject: Simplify theming for `Container` widget --- examples/pane_grid/src/main.rs | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'examples/pane_grid/src/main.rs') diff --git a/examples/pane_grid/src/main.rs b/examples/pane_grid/src/main.rs index 2bed5a03..eb904c3f 100644 --- a/examples/pane_grid/src/main.rs +++ b/examples/pane_grid/src/main.rs @@ -348,7 +348,10 @@ mod style { use iced::widget::container; use iced::{Border, Theme}; - pub fn title_bar_active(theme: &Theme) -> container::Appearance { + pub fn title_bar_active( + theme: &Theme, + _status: container::Status, + ) -> container::Appearance { let palette = theme.extended_palette(); container::Appearance { @@ -358,7 +361,10 @@ mod style { } } - pub fn title_bar_focused(theme: &Theme) -> container::Appearance { + pub fn title_bar_focused( + theme: &Theme, + _status: container::Status, + ) -> container::Appearance { let palette = theme.extended_palette(); container::Appearance { @@ -368,7 +374,10 @@ mod style { } } - pub fn pane_active(theme: &Theme) -> container::Appearance { + pub fn pane_active( + theme: &Theme, + _status: container::Status, + ) -> container::Appearance { let palette = theme.extended_palette(); container::Appearance { @@ -382,7 +391,10 @@ mod style { } } - pub fn pane_focused(theme: &Theme) -> container::Appearance { + pub fn pane_focused( + theme: &Theme, + _status: container::Status, + ) -> container::Appearance { let palette = theme.extended_palette(); container::Appearance { -- cgit From 44f002f64a9d53040f09affe69bd92675e302e16 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 7 Mar 2024 15:21:42 +0100 Subject: Rename `positive` and `destructive` to `success` and `danger` in `button` --- examples/pane_grid/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/pane_grid/src/main.rs') diff --git a/examples/pane_grid/src/main.rs b/examples/pane_grid/src/main.rs index eb904c3f..5e728ce1 100644 --- a/examples/pane_grid/src/main.rs +++ b/examples/pane_grid/src/main.rs @@ -287,7 +287,7 @@ fn view_content<'a>( ) ] .push_maybe(if total_panes > 1 && !is_pinned { - Some(button("Close", Message::Close(pane)).style(button::destructive)) + Some(button("Close", Message::Close(pane)).style(button::danger)) } else { None }) @@ -333,7 +333,7 @@ fn view_controls<'a>( }); let close = button(text("Close").size(14)) - .style(button::destructive) + .style(button::danger) .padding(3) .on_press_maybe(if total_panes > 1 && !is_pinned { Some(Message::Close(pane)) -- cgit