diff options
Diffstat (limited to 'src/widget.rs')
| -rw-r--r-- | src/widget.rs | 82 |
1 files changed, 45 insertions, 37 deletions
diff --git a/src/widget.rs b/src/widget.rs index 5e2b63fc..0c4ad224 100644 --- a/src/widget.rs +++ b/src/widget.rs @@ -15,43 +15,44 @@ //! [`TextInput`] has some [`text_input::State`]. /// A container that distributes its contents vertically. -pub type Column<'a, Message> = - iced_native::widget::Column<'a, Message, crate::Renderer>; +pub type Column<'a, Message, Theme = crate::Theme> = + iced_native::widget::Column<'a, Message, crate::Renderer<Theme>>; /// A container that distributes its contents horizontally. -pub type Row<'a, Message> = - iced_native::widget::Row<'a, Message, crate::Renderer>; +pub type Row<'a, Message, Theme = crate::Theme> = + iced_native::widget::Row<'a, Message, crate::Renderer<Theme>>; /// A paragraph of text. -pub type Text = iced_native::widget::Text<crate::Renderer>; +pub type Text<Theme = crate::Theme> = + iced_native::widget::Text<crate::Renderer<Theme>>; pub mod button { //! Allow your users to perform actions by pressing a button. //! //! A [`Button`] has some local [`State`]. - pub use iced_native::widget::button::{State, Style, StyleSheet}; + pub use iced_native::widget::button::{Appearance, State, StyleSheet}; /// A widget that produces a message when clicked. - pub type Button<'a, Message> = - iced_native::widget::Button<'a, Message, crate::Renderer>; + pub type Button<'a, Message, Theme = crate::Theme> = + iced_native::widget::Button<'a, Message, crate::Renderer<Theme>>; } pub mod checkbox { //! Show toggle controls using checkboxes. - pub use iced_native::widget::checkbox::{Style, StyleSheet}; + pub use iced_native::widget::checkbox::{Appearance, 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 { //! Decorate content and apply alignment. - pub use iced_native::widget::container::{Style, StyleSheet}; + pub use iced_native::widget::container::{Appearance, StyleSheet}; /// An element decorating some content. - pub type Container<'a, Message> = - iced_native::widget::Container<'a, Message, crate::Renderer>; + pub type Container<'a, Message, Theme = crate::Theme> = + iced_native::widget::Container<'a, Message, crate::Renderer<Theme>>; } pub mod pane_grid { @@ -73,35 +74,42 @@ pub mod pane_grid { /// to completely fill the space available. /// /// [](https://gfycat.com/mixedflatjellyfish) - pub type PaneGrid<'a, Message> = - iced_native::widget::PaneGrid<'a, Message, crate::Renderer>; + pub type PaneGrid<'a, Message, Theme> = + iced_native::widget::PaneGrid<'a, Message, crate::Renderer<Theme>>; /// The content of a [`Pane`]. - pub type Content<'a, Message> = - iced_native::widget::pane_grid::Content<'a, Message, crate::Renderer>; + pub type Content<'a, Message, Theme> = + iced_native::widget::pane_grid::Content< + 'a, + Message, + crate::Renderer<Theme>, + >; /// The title bar of a [`Pane`]. - pub type TitleBar<'a, Message> = - iced_native::widget::pane_grid::TitleBar<'a, Message, crate::Renderer>; + pub type TitleBar<'a, Message, Theme> = + iced_native::widget::pane_grid::TitleBar< + 'a, + Message, + crate::Renderer<Theme>, + >; } pub mod pick_list { //! Display a dropdown list of selectable values. - pub use iced_native::overlay::menu::Style as Menu; - pub use iced_native::widget::pick_list::{State, Style, StyleSheet}; + pub use iced_native::widget::pick_list::{Appearance, State, StyleSheet}; /// A widget allowing the selection of a single value from a list of options. - pub type PickList<'a, T, Message> = - iced_native::widget::PickList<'a, T, Message, crate::Renderer>; + pub type PickList<'a, T, Message, Theme> = + iced_native::widget::PickList<'a, T, Message, crate::Renderer<Theme>>; } pub mod radio { //! Create choices using radio buttons. - pub use iced_native::widget::radio::{Style, StyleSheet}; + pub use iced_native::widget::radio::{Appearance, StyleSheet}; /// A circular button representing a choice. - pub type Radio<'a, Message> = - iced_native::widget::Radio<'a, Message, crate::Renderer>; + pub type Radio<Message, Theme> = + iced_native::widget::Radio<Message, crate::Renderer<Theme>>; } pub mod scrollable { @@ -112,17 +120,17 @@ pub mod scrollable { /// A widget that can vertically display an infinite amount of content /// with a scrollbar. - pub type Scrollable<'a, Message> = - iced_native::widget::Scrollable<'a, Message, crate::Renderer>; + pub type Scrollable<'a, Message, Theme> = + iced_native::widget::Scrollable<'a, Message, crate::Renderer<Theme>>; } pub mod toggler { //! Show toggle controls using togglers. - pub use iced_native::widget::toggler::{Style, StyleSheet}; + pub use iced_native::widget::toggler::{Appearance, StyleSheet}; /// A toggler widget. - pub type Toggler<'a, Message> = - iced_native::widget::Toggler<'a, Message, crate::Renderer>; + pub type Toggler<'a, Message, Theme> = + iced_native::widget::Toggler<'a, Message, crate::Renderer<Theme>>; } pub mod text_input { @@ -131,11 +139,11 @@ pub mod text_input { //! A [`TextInput`] has some local [`State`]. use crate::Renderer; - pub use iced_native::widget::text_input::{State, Style, StyleSheet}; + pub use iced_native::widget::text_input::{Appearance, State, StyleSheet}; /// A field that can be filled with text. - pub type TextInput<'a, Message> = - iced_native::widget::TextInput<'a, Message, Renderer>; + pub type TextInput<'a, Message, Theme> = + iced_native::widget::TextInput<'a, Message, Renderer<Theme>>; } pub mod tooltip { @@ -143,8 +151,8 @@ pub mod tooltip { pub use iced_native::widget::tooltip::Position; /// A widget allowing the selection of a single value from a list of options. - pub type Tooltip<'a, Message> = - iced_native::widget::Tooltip<'a, Message, crate::Renderer>; + pub type Tooltip<'a, Message, Theme> = + iced_native::widget::Tooltip<'a, Message, crate::Renderer<Theme>>; } pub use iced_native::widget::progress_bar; |
