From e8ad66ef39df81f74d405947c10227c890fb3951 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Mon, 1 Dec 2025 20:28:56 +0100 Subject: [PATCH] Use `Background` for `background` and `foreground` in `toggler` Co-authored-by: B0ney <40839054+B0ney@users.noreply.github.com> --- widget/src/toggler.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/widget/src/toggler.rs b/widget/src/toggler.rs index 360a8109..cdb8cf5c 100644 --- a/widget/src/toggler.rs +++ b/widget/src/toggler.rs @@ -40,8 +40,8 @@ use crate::core::widget; use crate::core::widget::tree::{self, Tree}; use crate::core::window; use crate::core::{ - Border, Clipboard, Color, Element, Event, Layout, Length, Pixels, - Rectangle, Shell, Size, Theme, Widget, + Background, Border, Clipboard, Color, Element, Event, Layout, Length, + Pixels, Rectangle, Shell, Size, Theme, Widget, }; /// A toggler widget. @@ -516,13 +516,13 @@ pub enum Status { #[derive(Debug, Clone, Copy, PartialEq)] pub struct Style { /// The background [`Color`] of the toggler. - pub background: Color, + pub background: Background, /// The width of the background border of the toggler. pub background_border_width: f32, /// The [`Color`] of the background border of the toggler. pub background_border_color: Color, /// The foreground [`Color`] of the toggler. - pub foreground: Color, + pub foreground: Background, /// The width of the foreground border of the toggler. pub foreground_border_width: f32, /// The [`Color`] of the foreground border of the toggler. @@ -603,8 +603,8 @@ pub fn default(theme: &Theme, status: Status) -> Style { }; Style { - background, - foreground, + background: background.into(), + foreground: foreground.into(), foreground_border_width: 0.0, foreground_border_color: Color::TRANSPARENT, background_border_width: 0.0,