diff --git a/examples/cosmic/src/main.rs b/examples/cosmic/src/main.rs index 6e0c53db..e781d1ec 100644 --- a/examples/cosmic/src/main.rs +++ b/examples/cosmic/src/main.rs @@ -22,12 +22,12 @@ use cosmic::{ radio, row, slider, - text, - scrollable + text }, iced_lazy::responsive, iced_winit::window::drag, - WindowMsg + WindowMsg, + scrollable }; pub fn main() -> cosmic::iced::Result { @@ -259,13 +259,11 @@ impl Application for Window { } widgets.push( - scrollable(row![ + scrollable!(row![ horizontal_space(Length::Fill), if self.debug { content.explain(Color::WHITE) } else { content }, horizontal_space(Length::Fill), ]) - .scrollbar_width(8) - .scroller_width(8) .into() ); diff --git a/src/widget/mod.rs b/src/widget/mod.rs index e22aedcd..f26a0cae 100644 --- a/src/widget/mod.rs +++ b/src/widget/mod.rs @@ -16,5 +16,5 @@ pub use nav::*; mod toggler; pub use toggler::*; -mod scrollbar; -pub use scrollbar::*; \ No newline at end of file +mod scrollable; +pub use scrollable::*; \ No newline at end of file diff --git a/src/widget/nav.rs b/src/widget/nav.rs index 9ecad9ba..ac9719d3 100644 --- a/src/widget/nav.rs +++ b/src/widget/nav.rs @@ -9,7 +9,7 @@ use iced::{ macro_rules! nav_bar { ($($x:expr),+ $(,)?) => ( $crate::iced::widget::Container::new( - $crate::scrollbar!( + $crate::scrollable!( $crate::iced::widget::row![ $crate::iced::widget::Column::with_children( vec![$($crate::iced::Element::from($x)),+] diff --git a/src/widget/scrollbar.rs b/src/widget/scrollable.rs similarity index 85% rename from src/widget/scrollbar.rs rename to src/widget/scrollable.rs index ee31450c..1fa17720 100644 --- a/src/widget/scrollbar.rs +++ b/src/widget/scrollable.rs @@ -1,5 +1,5 @@ #[macro_export] -macro_rules! scrollbar { +macro_rules! scrollable { ($x:expr) => ( $crate::iced::widget::scrollable($x) .scrollbar_width(8)