summaryrefslogtreecommitdiffstats
path: root/examples/scrollable/src/style.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2022-06-01 01:56:46 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2022-06-01 01:56:46 +0200
commitc275fde67a7f5d1d5789540dc7905250a2f01fe7 (patch)
treee3ebeeebaeb69ff415b30d3720b00a8c0abf2d32 /examples/scrollable/src/style.rs
parent6f69df3d415bfc922ce15539746026843bd410e6 (diff)
downloadiced-c275fde67a7f5d1d5789540dc7905250a2f01fe7.tar.gz
iced-c275fde67a7f5d1d5789540dc7905250a2f01fe7.tar.bz2
iced-c275fde67a7f5d1d5789540dc7905250a2f01fe7.zip
Implement theme styling for `Rule`
Diffstat (limited to 'examples/scrollable/src/style.rs')
-rw-r--r--examples/scrollable/src/style.rs26
1 files changed, 2 insertions, 24 deletions
diff --git a/examples/scrollable/src/style.rs b/examples/scrollable/src/style.rs
index 0581a8c8..e15bf125 100644
--- a/examples/scrollable/src/style.rs
+++ b/examples/scrollable/src/style.rs
@@ -1,4 +1,4 @@
-use iced::{container, rule, scrollable};
+use iced::{container, scrollable};
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Theme {
@@ -34,17 +34,8 @@ impl<'a> From<Theme> for Box<dyn scrollable::StyleSheet + 'a> {
}
}
-impl From<Theme> for Box<dyn rule::StyleSheet> {
- fn from(theme: Theme) -> Self {
- match theme {
- Theme::Light => Default::default(),
- Theme::Dark => dark::Rule.into(),
- }
- }
-}
-
mod dark {
- use iced::{container, rule, scrollable, Color};
+ use iced::{container, scrollable, Color};
const BACKGROUND: Color = Color::from_rgb(
0x36 as f32 / 255.0,
@@ -139,17 +130,4 @@ mod dark {
}
}
}
-
- pub struct Rule;
-
- impl rule::StyleSheet for Rule {
- fn style(&self) -> rule::Style {
- rule::Style {
- color: SURFACE,
- width: 2,
- radius: 1.0,
- fill_mode: rule::FillMode::Percent(30.0),
- }
- }
- }
}