summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar BradySimon <bradytsimon@gmail.com>2024-10-12 19:55:41 -0400
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-10-14 20:59:32 +0200
commitf912d26d64c80fe767e97a0c79416d7398f04488 (patch)
tree7ab5b37c97532c2f65bae8783c6876dffa139ba4
parentc217500a5abd1fbfc1e598fb98dadd3ee85d8a51 (diff)
downloadiced-f912d26d64c80fe767e97a0c79416d7398f04488.tar.gz
iced-f912d26d64c80fe767e97a0c79416d7398f04488.tar.bz2
iced-f912d26d64c80fe767e97a0c79416d7398f04488.zip
Add `PartialEq` derives for widget styles
-rw-r--r--core/src/widget/text.rs2
-rw-r--r--widget/src/checkbox.rs2
-rw-r--r--widget/src/container.rs2
-rw-r--r--widget/src/overlay/menu.rs2
-rw-r--r--widget/src/pick_list.rs2
-rw-r--r--widget/src/progress_bar.rs2
-rw-r--r--widget/src/radio.rs2
-rw-r--r--widget/src/rule.rs4
-rw-r--r--widget/src/scrollable.rs6
-rw-r--r--widget/src/slider.rs8
-rw-r--r--widget/src/text_editor.rs2
-rw-r--r--widget/src/text_input.rs2
-rw-r--r--widget/src/toggler.rs2
13 files changed, 19 insertions, 19 deletions
diff --git a/core/src/widget/text.rs b/core/src/widget/text.rs
index 8b02f8c2..b34c5632 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 4b2f6075..819f0d9d 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 b256540c..f4993ac9 100644
--- a/widget/src/container.rs
+++ b/widget/src/container.rs
@@ -572,7 +572,7 @@ pub fn visible_bounds(id: Id) -> Task<Option<Rectangle>> {
}
/// 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<Color>,
diff --git a/widget/src/overlay/menu.rs b/widget/src/overlay/menu.rs
index f05ae40a..b641e8f5 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 ff54fe8a..4f1e9da9 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 8c665c8c..9d2b30f4 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 300318fd..d2a3bd6a 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 92199ca9..24577683 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 6d7f251e..528d63c1 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<Background>,
@@ -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 9477958d..31aa0e0c 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 a9322474..30575559 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 5bbf76f5..ff413779 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 3b412081..fdd2e68c 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,