From f912d26d64c80fe767e97a0c79416d7398f04488 Mon Sep 17 00:00:00 2001 From: BradySimon Date: Sat, 12 Oct 2024 19:55:41 -0400 Subject: [PATCH] Add `PartialEq` derives for widget styles --- core/src/widget/text.rs | 2 +- widget/src/checkbox.rs | 2 +- widget/src/container.rs | 2 +- widget/src/overlay/menu.rs | 2 +- widget/src/pick_list.rs | 2 +- widget/src/progress_bar.rs | 2 +- widget/src/radio.rs | 2 +- widget/src/rule.rs | 4 ++-- widget/src/scrollable.rs | 6 +++--- widget/src/slider.rs | 8 ++++---- widget/src/text_editor.rs | 2 +- widget/src/text_input.rs | 2 +- widget/src/toggler.rs | 2 +- 13 files changed, 19 insertions(+), 19 deletions(-) diff --git a/core/src/widget/text.rs b/core/src/widget/text.rs index 8b02f8c238..b34c5632d9 100644 --- a/core/src/widget/text.rs +++ b/core/src/widget/text.rs @@ -389,7 +389,7 @@ where } /// The appearance of some text. -#[derive(Debug, Clone, Copy, Default)] +#[derive(Debug, Clone, Copy, PartialEq, Default)] pub struct Style { /// The [`Color`] of the text. /// diff --git a/widget/src/checkbox.rs b/widget/src/checkbox.rs index 4b2f6075dd..819f0d9da1 100644 --- a/widget/src/checkbox.rs +++ b/widget/src/checkbox.rs @@ -481,7 +481,7 @@ pub enum Status { } /// The style of a checkbox. -#[derive(Debug, Clone, Copy)] +#[derive(Debug, Clone, Copy, PartialEq)] pub struct Style { /// The [`Background`] of the checkbox. pub background: Background, diff --git a/widget/src/container.rs b/widget/src/container.rs index b256540c1c..f4993ac935 100644 --- a/widget/src/container.rs +++ b/widget/src/container.rs @@ -572,7 +572,7 @@ pub fn visible_bounds(id: Id) -> Task> { } /// The appearance of a container. -#[derive(Debug, Clone, Copy, Default)] +#[derive(Debug, Clone, Copy, PartialEq, Default)] pub struct Style { /// The text [`Color`] of the container. pub text_color: Option, diff --git a/widget/src/overlay/menu.rs b/widget/src/overlay/menu.rs index f05ae40a82..b641e8f516 100644 --- a/widget/src/overlay/menu.rs +++ b/widget/src/overlay/menu.rs @@ -562,7 +562,7 @@ where } /// The appearance of a [`Menu`]. -#[derive(Debug, Clone, Copy)] +#[derive(Debug, Clone, Copy, PartialEq)] pub struct Style { /// The [`Background`] of the menu. pub background: Background, diff --git a/widget/src/pick_list.rs b/widget/src/pick_list.rs index ff54fe8a69..4f1e9da9cd 100644 --- a/widget/src/pick_list.rs +++ b/widget/src/pick_list.rs @@ -828,7 +828,7 @@ pub enum Status { } /// The appearance of a pick list. -#[derive(Debug, Clone, Copy)] +#[derive(Debug, Clone, Copy, PartialEq)] pub struct Style { /// The text [`Color`] of the pick list. pub text_color: Color, diff --git a/widget/src/progress_bar.rs b/widget/src/progress_bar.rs index 8c665c8cba..9d2b30f408 100644 --- a/widget/src/progress_bar.rs +++ b/widget/src/progress_bar.rs @@ -208,7 +208,7 @@ where } /// The appearance of a progress bar. -#[derive(Debug, Clone, Copy)] +#[derive(Debug, Clone, Copy, PartialEq)] pub struct Style { /// The [`Background`] of the progress bar. pub background: Background, diff --git a/widget/src/radio.rs b/widget/src/radio.rs index 300318fde8..d2a3bd6a37 100644 --- a/widget/src/radio.rs +++ b/widget/src/radio.rs @@ -471,7 +471,7 @@ pub enum Status { } /// The appearance of a radio button. -#[derive(Debug, Clone, Copy)] +#[derive(Debug, Clone, Copy, PartialEq)] pub struct Style { /// The [`Background`] of the radio button. pub background: Background, diff --git a/widget/src/rule.rs b/widget/src/rule.rs index 92199ca9bf..2457768367 100644 --- a/widget/src/rule.rs +++ b/widget/src/rule.rs @@ -187,7 +187,7 @@ where } /// The appearance of a rule. -#[derive(Debug, Clone, Copy)] +#[derive(Debug, Clone, Copy, PartialEq)] pub struct Style { /// The color of the rule. pub color: Color, @@ -200,7 +200,7 @@ pub struct Style { } /// The fill mode of a rule. -#[derive(Debug, Clone, Copy)] +#[derive(Debug, Clone, Copy, PartialEq)] pub enum FillMode { /// Fill the whole length of the container. Full, diff --git a/widget/src/scrollable.rs b/widget/src/scrollable.rs index 6d7f251efb..528d63c1da 100644 --- a/widget/src/scrollable.rs +++ b/widget/src/scrollable.rs @@ -1856,7 +1856,7 @@ pub enum Status { } /// The appearance of a scrollable. -#[derive(Debug, Clone, Copy)] +#[derive(Debug, Clone, Copy, PartialEq)] pub struct Style { /// The [`container::Style`] of a scrollable. pub container: container::Style, @@ -1869,7 +1869,7 @@ pub struct Style { } /// The appearance of the scrollbar of a scrollable. -#[derive(Debug, Clone, Copy)] +#[derive(Debug, Clone, Copy, PartialEq)] pub struct Rail { /// The [`Background`] of a scrollbar. pub background: Option, @@ -1880,7 +1880,7 @@ pub struct Rail { } /// The appearance of the scroller of a scrollable. -#[derive(Debug, Clone, Copy)] +#[derive(Debug, Clone, Copy, PartialEq)] pub struct Scroller { /// The [`Color`] of the scroller. pub color: Color, diff --git a/widget/src/slider.rs b/widget/src/slider.rs index 9477958d3d..31aa0e0cba 100644 --- a/widget/src/slider.rs +++ b/widget/src/slider.rs @@ -562,7 +562,7 @@ pub enum Status { } /// The appearance of a slider. -#[derive(Debug, Clone, Copy)] +#[derive(Debug, Clone, Copy, PartialEq)] pub struct Style { /// The colors of the rail of the slider. pub rail: Rail, @@ -582,7 +582,7 @@ impl Style { } /// The appearance of a slider rail -#[derive(Debug, Clone, Copy)] +#[derive(Debug, Clone, Copy, PartialEq)] pub struct Rail { /// The backgrounds of the rail of the slider. pub backgrounds: (Background, Background), @@ -593,7 +593,7 @@ pub struct Rail { } /// The appearance of the handle of a slider. -#[derive(Debug, Clone, Copy)] +#[derive(Debug, Clone, Copy, PartialEq)] pub struct Handle { /// The shape of the handle. pub shape: HandleShape, @@ -606,7 +606,7 @@ pub struct Handle { } /// The shape of the handle of a slider. -#[derive(Debug, Clone, Copy)] +#[derive(Debug, Clone, Copy, PartialEq)] pub enum HandleShape { /// A circular handle. Circle { diff --git a/widget/src/text_editor.rs b/widget/src/text_editor.rs index a93224743f..3057555907 100644 --- a/widget/src/text_editor.rs +++ b/widget/src/text_editor.rs @@ -1226,7 +1226,7 @@ pub enum Status { } /// The appearance of a text input. -#[derive(Debug, Clone, Copy)] +#[derive(Debug, Clone, Copy, PartialEq)] pub struct Style { /// The [`Background`] of the text input. pub background: Background, diff --git a/widget/src/text_input.rs b/widget/src/text_input.rs index 5bbf76f59a..ff41377946 100644 --- a/widget/src/text_input.rs +++ b/widget/src/text_input.rs @@ -1541,7 +1541,7 @@ pub enum Status { } /// The appearance of a text input. -#[derive(Debug, Clone, Copy)] +#[derive(Debug, Clone, Copy, PartialEq)] pub struct Style { /// The [`Background`] of the text input. pub background: Background, diff --git a/widget/src/toggler.rs b/widget/src/toggler.rs index 3b41208195..fdd2e68c31 100644 --- a/widget/src/toggler.rs +++ b/widget/src/toggler.rs @@ -489,7 +489,7 @@ pub enum Status { } /// The appearance of a toggler. -#[derive(Debug, Clone, Copy)] +#[derive(Debug, Clone, Copy, PartialEq)] pub struct Style { /// The background [`Color`] of the toggler. pub background: Color,