diff options
Diffstat (limited to 'src/pure/widget.rs')
-rw-r--r-- | src/pure/widget.rs | 67 |
1 files changed, 38 insertions, 29 deletions
diff --git a/src/pure/widget.rs b/src/pure/widget.rs index c84edde3..1c0a32a6 100644 --- a/src/pure/widget.rs +++ b/src/pure/widget.rs @@ -1,23 +1,24 @@ //! Pure versions of the widgets. /// A container that distributes its contents vertically. -pub type Column<'a, Message> = - iced_pure::widget::Column<'a, Message, crate::Renderer>; +pub type Column<'a, Message, Theme = crate::Theme> = + iced_pure::widget::Column<'a, Message, crate::Renderer<Theme>>; /// A container that distributes its contents horizontally. -pub type Row<'a, Message> = - iced_pure::widget::Row<'a, Message, crate::Renderer>; +pub type Row<'a, Message, Theme = crate::Theme> = + iced_pure::widget::Row<'a, Message, crate::Renderer<Theme>>; /// A paragraph of text. -pub type Text = iced_pure::widget::Text<crate::Renderer>; +pub type Text<Theme = crate::Theme> = + iced_pure::widget::Text<crate::Renderer<Theme>>; pub mod button { //! Allow your users to perform actions by pressing a button. pub use iced_pure::widget::button::{Style, StyleSheet}; /// A widget that produces a message when clicked. - pub type Button<'a, Message> = - iced_pure::widget::Button<'a, Message, crate::Renderer>; + pub type Button<'a, Message, Theme = crate::Theme> = + iced_pure::widget::Button<'a, Message, crate::Renderer<Theme>>; } pub mod checkbox { @@ -25,8 +26,8 @@ pub mod checkbox { pub use iced_pure::widget::checkbox::{Style, StyleSheet}; /// A box that can be checked. - pub type Checkbox<'a, Message> = - iced_native::widget::Checkbox<'a, Message, crate::Renderer>; + pub type Checkbox<'a, Message, Theme> = + iced_native::widget::Checkbox<'a, Message, crate::Renderer<Theme>>; } pub mod container { @@ -34,8 +35,8 @@ pub mod container { pub use iced_pure::widget::container::{Style, StyleSheet}; /// An element decorating some content. - pub type Container<'a, Message> = - iced_pure::widget::Container<'a, Message, crate::Renderer>; + pub type Container<'a, Message, Theme = crate::Theme> = + iced_pure::widget::Container<'a, Message, crate::Renderer<Theme>>; } pub mod pane_grid { @@ -57,16 +58,24 @@ pub mod pane_grid { /// to completely fill the space available. /// /// [](https://gfycat.com/mixedflatjellyfish) - pub type PaneGrid<'a, Message> = - iced_pure::widget::PaneGrid<'a, Message, crate::Renderer>; + pub type PaneGrid<'a, Message, Theme> = + iced_pure::widget::PaneGrid<'a, Message, crate::Renderer<Theme>>; /// The content of a [`Pane`]. - pub type Content<'a, Message> = - iced_pure::widget::pane_grid::Content<'a, Message, crate::Renderer>; + pub type Content<'a, Message, Theme> = + iced_pure::widget::pane_grid::Content< + 'a, + Message, + crate::Renderer<Theme>, + >; /// The title bar of a [`Pane`]. - pub type TitleBar<'a, Message> = - iced_pure::widget::pane_grid::TitleBar<'a, Message, crate::Renderer>; + pub type TitleBar<'a, Message, Theme> = + iced_pure::widget::pane_grid::TitleBar< + 'a, + Message, + crate::Renderer<Theme>, + >; } pub mod pick_list { @@ -75,8 +84,8 @@ pub mod pick_list { pub use iced_pure::widget::pick_list::{Style, StyleSheet}; /// A widget allowing the selection of a single value from a list of options. - pub type PickList<'a, T, Message> = - iced_pure::widget::PickList<'a, T, Message, crate::Renderer>; + pub type PickList<'a, T, Message, Theme> = + iced_pure::widget::PickList<'a, T, Message, crate::Renderer<Theme>>; } pub mod radio { @@ -84,8 +93,8 @@ pub mod radio { pub use iced_pure::widget::radio::{Style, StyleSheet}; /// A circular button representing a choice. - pub type Radio<'a, Message> = - iced_pure::widget::Radio<'a, Message, crate::Renderer>; + pub type Radio<'a, Message, Theme> = + iced_pure::widget::Radio<'a, Message, crate::Renderer<Theme>>; } pub mod scrollable { @@ -94,8 +103,8 @@ pub mod scrollable { /// A widget that can vertically display an infinite amount of content /// with a scrollbar. - pub type Scrollable<'a, Message> = - iced_pure::widget::Scrollable<'a, Message, crate::Renderer>; + pub type Scrollable<'a, Message, Theme> = + iced_pure::widget::Scrollable<'a, Message, crate::Renderer<Theme>>; } pub mod toggler { @@ -103,8 +112,8 @@ pub mod toggler { pub use iced_pure::widget::toggler::{Style, StyleSheet}; /// A toggler widget. - pub type Toggler<'a, Message> = - iced_pure::widget::Toggler<'a, Message, crate::Renderer>; + pub type Toggler<'a, Message, Theme> = + iced_pure::widget::Toggler<'a, Message, crate::Renderer<Theme>>; } pub mod text_input { @@ -114,8 +123,8 @@ pub mod text_input { pub use iced_pure::widget::text_input::{Style, StyleSheet}; /// A field that can be filled with text. - pub type TextInput<'a, Message> = - iced_pure::widget::TextInput<'a, Message, Renderer>; + pub type TextInput<'a, Message, Theme> = + iced_pure::widget::TextInput<'a, Message, Renderer<Theme>>; } pub mod tooltip { @@ -123,8 +132,8 @@ pub mod tooltip { pub use iced_pure::widget::tooltip::Position; /// A widget allowing the selection of a single value from a list of options. - pub type Tooltip<'a, Message> = - iced_pure::widget::Tooltip<'a, Message, crate::Renderer>; + pub type Tooltip<'a, Message, Theme> = + iced_pure::widget::Tooltip<'a, Message, crate::Renderer<Theme>>; } pub use iced_pure::widget::progress_bar; |