summaryrefslogtreecommitdiffstats
path: root/style
diff options
context:
space:
mode:
authorLibravatar Giuliano Bellini s294739 <s294739@studenti.polito.it>2024-01-27 21:56:28 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-02-07 20:29:24 +0100
commitae3f5ba1a33f47692bc39080a0d2e12b8106499f (patch)
tree7f86abcf2644e8d2e94257e4b8063d1b49656bda /style
parent80a29a277e2f15c0711efc37dc6c86c2ef98879e (diff)
downloadiced-ae3f5ba1a33f47692bc39080a0d2e12b8106499f.tar.gz
iced-ae3f5ba1a33f47692bc39080a0d2e12b8106499f.tar.bz2
iced-ae3f5ba1a33f47692bc39080a0d2e12b8106499f.zip
add border widths to toggler stylesheet
Diffstat (limited to 'style')
-rw-r--r--style/src/theme.rs6
-rw-r--r--style/src/toggler.rs8
2 files changed, 10 insertions, 4 deletions
diff --git a/style/src/theme.rs b/style/src/theme.rs
index 96f91260..e579a1c2 100644
--- a/style/src/theme.rs
+++ b/style/src/theme.rs
@@ -797,13 +797,15 @@ impl toggler::StyleSheet for Theme {
} else {
palette.background.strong.color
},
- background_border: None,
+ background_border_width: 0.0,
+ background_border_color: Color::TRANSPARENT,
foreground: if is_active {
palette.primary.strong.text
} else {
palette.background.base.color
},
- foreground_border: None,
+ foreground_border_width: 0.0,
+ foreground_border_color: Color::TRANSPARENT,
}
}
Toggler::Custom(custom) => custom.active(self, is_active),
diff --git a/style/src/toggler.rs b/style/src/toggler.rs
index abc73f2a..731e87ce 100644
--- a/style/src/toggler.rs
+++ b/style/src/toggler.rs
@@ -6,12 +6,16 @@ use iced_core::Color;
pub struct Appearance {
/// The background [`Color`] of the toggler.
pub background: Color,
+ /// 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: Option<Color>,
+ pub background_border_color: Color,
/// The foreground [`Color`] of the toggler.
pub foreground: Color,
+ /// The width of the foreground border of the toggler.
+ pub foreground_border_width: f32,
/// The [`Color`] of the foreground border of the toggler.
- pub foreground_border: Option<Color>,
+ pub foreground_border_color: Color,
}
/// A set of rules that dictate the style of a toggler.