diff options
author | 2024-02-06 13:55:42 -0500 | |
---|---|---|
committer | 2024-02-12 19:03:32 +0100 | |
commit | 0f920e0435932c0b6927c771424b2ba495ddb46e (patch) | |
tree | 36ff23cfa2ec6ec82457e521f8ebaad7a99ebc32 /examples/scrollable | |
parent | 891f29eea0cb32f0bee49fbace1757b82e1937f3 (diff) | |
download | iced-0f920e0435932c0b6927c771424b2ba495ddb46e.tar.gz iced-0f920e0435932c0b6927c771424b2ba495ddb46e.tar.bz2 iced-0f920e0435932c0b6927c771424b2ba495ddb46e.zip |
Introduce an appearance for a scrollable, ability to customize the scrollbar gap.
Update scrollable.rs
Diffstat (limited to 'examples/scrollable')
-rw-r--r-- | examples/scrollable/src/main.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/scrollable/src/main.rs b/examples/scrollable/src/main.rs index ff691917..5f5cfdc6 100644 --- a/examples/scrollable/src/main.rs +++ b/examples/scrollable/src/main.rs @@ -1,6 +1,6 @@ use iced::executor; use iced::theme; -use iced::widget::scrollable::{Properties, Scrollbar, Scroller}; +use iced::widget::scrollable::{Appearance, Properties, Scrollbar, Scroller}; use iced::widget::{ button, column, container, horizontal_space, progress_bar, radio, row, scrollable, slider, text, vertical_space, @@ -355,6 +355,10 @@ struct ScrollbarCustomStyle; impl scrollable::StyleSheet for ScrollbarCustomStyle { type Style = Theme; + fn appearance(&self, style: &Self::Style) -> Appearance { + style.appearance(&theme::Scrollable::Default) + } + fn active(&self, style: &Self::Style) -> Scrollbar { style.active(&theme::Scrollable::Default) } |