Make widget aliases in iced compatible with iced_native
This commit is contained in:
parent
3e643a9d6b
commit
2d6d26cef4
2 changed files with 58 additions and 80 deletions
|
|
@ -1,24 +1,23 @@
|
||||||
//! Pure versions of the widgets.
|
//! Pure versions of the widgets.
|
||||||
|
|
||||||
/// A container that distributes its contents vertically.
|
/// A container that distributes its contents vertically.
|
||||||
pub type Column<'a, Message, Theme = crate::Theme> =
|
pub type Column<'a, Message, Renderer = crate::Renderer> =
|
||||||
iced_pure::widget::Column<'a, Message, crate::Renderer<Theme>>;
|
iced_pure::widget::Column<'a, Message, Renderer>;
|
||||||
|
|
||||||
/// A container that distributes its contents horizontally.
|
/// A container that distributes its contents horizontally.
|
||||||
pub type Row<'a, Message, Theme = crate::Theme> =
|
pub type Row<'a, Message, Renderer = crate::Renderer> =
|
||||||
iced_pure::widget::Row<'a, Message, crate::Renderer<Theme>>;
|
iced_pure::widget::Row<'a, Message, Renderer>;
|
||||||
|
|
||||||
/// A paragraph of text.
|
/// A paragraph of text.
|
||||||
pub type Text<Theme = crate::Theme> =
|
pub type Text<Renderer = crate::Renderer> = iced_pure::widget::Text<Renderer>;
|
||||||
iced_pure::widget::Text<crate::Renderer<Theme>>;
|
|
||||||
|
|
||||||
pub mod button {
|
pub mod button {
|
||||||
//! Allow your users to perform actions by pressing a button.
|
//! Allow your users to perform actions by pressing a button.
|
||||||
pub use iced_pure::widget::button::{Appearance, StyleSheet};
|
pub use iced_pure::widget::button::{Appearance, StyleSheet};
|
||||||
|
|
||||||
/// A widget that produces a message when clicked.
|
/// A widget that produces a message when clicked.
|
||||||
pub type Button<'a, Message, Theme = crate::Theme> =
|
pub type Button<'a, Message, Renderer = crate::Renderer> =
|
||||||
iced_pure::widget::Button<'a, Message, crate::Renderer<Theme>>;
|
iced_pure::widget::Button<'a, Message, Renderer>;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub mod checkbox {
|
pub mod checkbox {
|
||||||
|
|
@ -26,8 +25,8 @@ pub mod checkbox {
|
||||||
pub use iced_pure::widget::checkbox::{Appearance, StyleSheet};
|
pub use iced_pure::widget::checkbox::{Appearance, StyleSheet};
|
||||||
|
|
||||||
/// A box that can be checked.
|
/// A box that can be checked.
|
||||||
pub type Checkbox<'a, Message, Theme> =
|
pub type Checkbox<'a, Message, Renderer = crate::Renderer> =
|
||||||
iced_native::widget::Checkbox<'a, Message, crate::Renderer<Theme>>;
|
iced_native::widget::Checkbox<'a, Message, Renderer>;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub mod container {
|
pub mod container {
|
||||||
|
|
@ -35,8 +34,8 @@ pub mod container {
|
||||||
pub use iced_pure::widget::container::{Appearance, StyleSheet};
|
pub use iced_pure::widget::container::{Appearance, StyleSheet};
|
||||||
|
|
||||||
/// An element decorating some content.
|
/// An element decorating some content.
|
||||||
pub type Container<'a, Message, Theme = crate::Theme> =
|
pub type Container<'a, Message, Renderer = crate::Renderer> =
|
||||||
iced_pure::widget::Container<'a, Message, crate::Renderer<Theme>>;
|
iced_pure::widget::Container<'a, Message, Renderer>;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub mod pane_grid {
|
pub mod pane_grid {
|
||||||
|
|
@ -58,24 +57,16 @@ pub mod pane_grid {
|
||||||
/// to completely fill the space available.
|
/// to completely fill the space available.
|
||||||
///
|
///
|
||||||
/// [](https://gfycat.com/mixedflatjellyfish)
|
/// [](https://gfycat.com/mixedflatjellyfish)
|
||||||
pub type PaneGrid<'a, Message, Theme> =
|
pub type PaneGrid<'a, Message, Renderer = crate::Renderer> =
|
||||||
iced_pure::widget::PaneGrid<'a, Message, crate::Renderer<Theme>>;
|
iced_pure::widget::PaneGrid<'a, Message, Renderer>;
|
||||||
|
|
||||||
/// The content of a [`Pane`].
|
/// The content of a [`Pane`].
|
||||||
pub type Content<'a, Message, Theme> =
|
pub type Content<'a, Message, Renderer = crate::Renderer> =
|
||||||
iced_pure::widget::pane_grid::Content<
|
iced_pure::widget::pane_grid::Content<'a, Message, Renderer>;
|
||||||
'a,
|
|
||||||
Message,
|
|
||||||
crate::Renderer<Theme>,
|
|
||||||
>;
|
|
||||||
|
|
||||||
/// The title bar of a [`Pane`].
|
/// The title bar of a [`Pane`].
|
||||||
pub type TitleBar<'a, Message, Theme> =
|
pub type TitleBar<'a, Message, Renderer = crate::Renderer> =
|
||||||
iced_pure::widget::pane_grid::TitleBar<
|
iced_pure::widget::pane_grid::TitleBar<'a, Message, Renderer>;
|
||||||
'a,
|
|
||||||
Message,
|
|
||||||
crate::Renderer<Theme>,
|
|
||||||
>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub mod pick_list {
|
pub mod pick_list {
|
||||||
|
|
@ -83,8 +74,8 @@ pub mod pick_list {
|
||||||
pub use iced_pure::widget::pick_list::{Appearance, StyleSheet};
|
pub use iced_pure::widget::pick_list::{Appearance, StyleSheet};
|
||||||
|
|
||||||
/// A widget allowing the selection of a single value from a list of options.
|
/// A widget allowing the selection of a single value from a list of options.
|
||||||
pub type PickList<'a, T, Message, Theme> =
|
pub type PickList<'a, T, Message, Renderer = crate::Renderer> =
|
||||||
iced_pure::widget::PickList<'a, T, Message, crate::Renderer<Theme>>;
|
iced_pure::widget::PickList<'a, T, Message, Renderer>;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub mod radio {
|
pub mod radio {
|
||||||
|
|
@ -92,8 +83,8 @@ pub mod radio {
|
||||||
pub use iced_pure::widget::radio::{Appearance, StyleSheet};
|
pub use iced_pure::widget::radio::{Appearance, StyleSheet};
|
||||||
|
|
||||||
/// A circular button representing a choice.
|
/// A circular button representing a choice.
|
||||||
pub type Radio<Message, Theme> =
|
pub type Radio<Message, Renderer = crate::Renderer> =
|
||||||
iced_pure::widget::Radio<Message, crate::Renderer<Theme>>;
|
iced_pure::widget::Radio<Message, Renderer>;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub mod scrollable {
|
pub mod scrollable {
|
||||||
|
|
@ -102,8 +93,8 @@ pub mod scrollable {
|
||||||
|
|
||||||
/// A widget that can vertically display an infinite amount of content
|
/// A widget that can vertically display an infinite amount of content
|
||||||
/// with a scrollbar.
|
/// with a scrollbar.
|
||||||
pub type Scrollable<'a, Message, Theme> =
|
pub type Scrollable<'a, Message, Renderer = crate::Renderer> =
|
||||||
iced_pure::widget::Scrollable<'a, Message, crate::Renderer<Theme>>;
|
iced_pure::widget::Scrollable<'a, Message, Renderer>;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub mod toggler {
|
pub mod toggler {
|
||||||
|
|
@ -111,19 +102,17 @@ pub mod toggler {
|
||||||
pub use iced_pure::widget::toggler::{Appearance, StyleSheet};
|
pub use iced_pure::widget::toggler::{Appearance, StyleSheet};
|
||||||
|
|
||||||
/// A toggler widget.
|
/// A toggler widget.
|
||||||
pub type Toggler<'a, Message, Theme> =
|
pub type Toggler<'a, Message, Renderer = crate::Renderer> =
|
||||||
iced_pure::widget::Toggler<'a, Message, crate::Renderer<Theme>>;
|
iced_pure::widget::Toggler<'a, Message, Renderer>;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub mod text_input {
|
pub mod text_input {
|
||||||
//! Display fields that can be filled with text.
|
//! Display fields that can be filled with text.
|
||||||
use crate::Renderer;
|
|
||||||
|
|
||||||
pub use iced_pure::widget::text_input::{Appearance, StyleSheet};
|
pub use iced_pure::widget::text_input::{Appearance, StyleSheet};
|
||||||
|
|
||||||
/// A field that can be filled with text.
|
/// A field that can be filled with text.
|
||||||
pub type TextInput<'a, Message, Theme> =
|
pub type TextInput<'a, Message, Renderer = crate::Renderer> =
|
||||||
iced_pure::widget::TextInput<'a, Message, Renderer<Theme>>;
|
iced_pure::widget::TextInput<'a, Message, Renderer>;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub mod tooltip {
|
pub mod tooltip {
|
||||||
|
|
@ -131,8 +120,8 @@ pub mod tooltip {
|
||||||
pub use iced_pure::widget::tooltip::Position;
|
pub use iced_pure::widget::tooltip::Position;
|
||||||
|
|
||||||
/// A widget allowing the selection of a single value from a list of options.
|
/// A widget allowing the selection of a single value from a list of options.
|
||||||
pub type Tooltip<'a, Message, Theme> =
|
pub type Tooltip<'a, Message, Renderer = crate::Renderer> =
|
||||||
iced_pure::widget::Tooltip<'a, Message, crate::Renderer<Theme>>;
|
iced_pure::widget::Tooltip<'a, Message, Renderer>;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub use iced_pure::widget::progress_bar;
|
pub use iced_pure::widget::progress_bar;
|
||||||
|
|
|
||||||
|
|
@ -15,16 +15,15 @@
|
||||||
//! [`TextInput`] has some [`text_input::State`].
|
//! [`TextInput`] has some [`text_input::State`].
|
||||||
|
|
||||||
/// A container that distributes its contents vertically.
|
/// A container that distributes its contents vertically.
|
||||||
pub type Column<'a, Message, Theme = crate::Theme> =
|
pub type Column<'a, Message, Renderer = crate::Renderer> =
|
||||||
iced_native::widget::Column<'a, Message, crate::Renderer<Theme>>;
|
iced_native::widget::Column<'a, Message, Renderer>;
|
||||||
|
|
||||||
/// A container that distributes its contents horizontally.
|
/// A container that distributes its contents horizontally.
|
||||||
pub type Row<'a, Message, Theme = crate::Theme> =
|
pub type Row<'a, Message, Renderer = crate::Renderer> =
|
||||||
iced_native::widget::Row<'a, Message, crate::Renderer<Theme>>;
|
iced_native::widget::Row<'a, Message, Renderer>;
|
||||||
|
|
||||||
/// A paragraph of text.
|
/// A paragraph of text.
|
||||||
pub type Text<Theme = crate::Theme> =
|
pub type Text<Renderer = crate::Renderer> = iced_native::widget::Text<Renderer>;
|
||||||
iced_native::widget::Text<crate::Renderer<Theme>>;
|
|
||||||
|
|
||||||
pub mod button {
|
pub mod button {
|
||||||
//! Allow your users to perform actions by pressing a button.
|
//! Allow your users to perform actions by pressing a button.
|
||||||
|
|
@ -33,8 +32,8 @@ pub mod button {
|
||||||
pub use iced_native::widget::button::{Appearance, State, StyleSheet};
|
pub use iced_native::widget::button::{Appearance, State, StyleSheet};
|
||||||
|
|
||||||
/// A widget that produces a message when clicked.
|
/// A widget that produces a message when clicked.
|
||||||
pub type Button<'a, Message, Theme = crate::Theme> =
|
pub type Button<'a, Message, Renderer = crate::Renderer> =
|
||||||
iced_native::widget::Button<'a, Message, crate::Renderer<Theme>>;
|
iced_native::widget::Button<'a, Message, Renderer>;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub mod checkbox {
|
pub mod checkbox {
|
||||||
|
|
@ -42,8 +41,8 @@ pub mod checkbox {
|
||||||
pub use iced_native::widget::checkbox::{Appearance, StyleSheet};
|
pub use iced_native::widget::checkbox::{Appearance, StyleSheet};
|
||||||
|
|
||||||
/// A box that can be checked.
|
/// A box that can be checked.
|
||||||
pub type Checkbox<'a, Message, Theme> =
|
pub type Checkbox<'a, Message, Renderer = crate::Renderer> =
|
||||||
iced_native::widget::Checkbox<'a, Message, crate::Renderer<Theme>>;
|
iced_native::widget::Checkbox<'a, Message, Renderer>;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub mod container {
|
pub mod container {
|
||||||
|
|
@ -51,8 +50,8 @@ pub mod container {
|
||||||
pub use iced_native::widget::container::{Appearance, StyleSheet};
|
pub use iced_native::widget::container::{Appearance, StyleSheet};
|
||||||
|
|
||||||
/// An element decorating some content.
|
/// An element decorating some content.
|
||||||
pub type Container<'a, Message, Theme = crate::Theme> =
|
pub type Container<'a, Message, Renderer = crate::Renderer> =
|
||||||
iced_native::widget::Container<'a, Message, crate::Renderer<Theme>>;
|
iced_native::widget::Container<'a, Message, Renderer>;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub mod pane_grid {
|
pub mod pane_grid {
|
||||||
|
|
@ -74,24 +73,16 @@ pub mod pane_grid {
|
||||||
/// to completely fill the space available.
|
/// to completely fill the space available.
|
||||||
///
|
///
|
||||||
/// [](https://gfycat.com/mixedflatjellyfish)
|
/// [](https://gfycat.com/mixedflatjellyfish)
|
||||||
pub type PaneGrid<'a, Message, Theme> =
|
pub type PaneGrid<'a, Message, Renderer = crate::Renderer> =
|
||||||
iced_native::widget::PaneGrid<'a, Message, crate::Renderer<Theme>>;
|
iced_native::widget::PaneGrid<'a, Message, Renderer>;
|
||||||
|
|
||||||
/// The content of a [`Pane`].
|
/// The content of a [`Pane`].
|
||||||
pub type Content<'a, Message, Theme> =
|
pub type Content<'a, Message, Renderer = crate::Renderer> =
|
||||||
iced_native::widget::pane_grid::Content<
|
iced_native::widget::pane_grid::Content<'a, Message, Renderer>;
|
||||||
'a,
|
|
||||||
Message,
|
|
||||||
crate::Renderer<Theme>,
|
|
||||||
>;
|
|
||||||
|
|
||||||
/// The title bar of a [`Pane`].
|
/// The title bar of a [`Pane`].
|
||||||
pub type TitleBar<'a, Message, Theme> =
|
pub type TitleBar<'a, Message, Renderer = crate::Renderer> =
|
||||||
iced_native::widget::pane_grid::TitleBar<
|
iced_native::widget::pane_grid::TitleBar<'a, Message, Renderer>;
|
||||||
'a,
|
|
||||||
Message,
|
|
||||||
crate::Renderer<Theme>,
|
|
||||||
>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub mod pick_list {
|
pub mod pick_list {
|
||||||
|
|
@ -99,8 +90,8 @@ pub mod pick_list {
|
||||||
pub use iced_native::widget::pick_list::{Appearance, State, 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.
|
/// A widget allowing the selection of a single value from a list of options.
|
||||||
pub type PickList<'a, T, Message, Theme> =
|
pub type PickList<'a, T, Message, Renderer = crate::Renderer> =
|
||||||
iced_native::widget::PickList<'a, T, Message, crate::Renderer<Theme>>;
|
iced_native::widget::PickList<'a, T, Message, Renderer>;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub mod radio {
|
pub mod radio {
|
||||||
|
|
@ -108,8 +99,8 @@ pub mod radio {
|
||||||
pub use iced_native::widget::radio::{Appearance, StyleSheet};
|
pub use iced_native::widget::radio::{Appearance, StyleSheet};
|
||||||
|
|
||||||
/// A circular button representing a choice.
|
/// A circular button representing a choice.
|
||||||
pub type Radio<Message, Theme> =
|
pub type Radio<Message, Renderer = crate::Renderer> =
|
||||||
iced_native::widget::Radio<Message, crate::Renderer<Theme>>;
|
iced_native::widget::Radio<Message, Renderer>;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub mod scrollable {
|
pub mod scrollable {
|
||||||
|
|
@ -120,8 +111,8 @@ pub mod scrollable {
|
||||||
|
|
||||||
/// A widget that can vertically display an infinite amount of content
|
/// A widget that can vertically display an infinite amount of content
|
||||||
/// with a scrollbar.
|
/// with a scrollbar.
|
||||||
pub type Scrollable<'a, Message, Theme> =
|
pub type Scrollable<'a, Message, Renderer = crate::Renderer> =
|
||||||
iced_native::widget::Scrollable<'a, Message, crate::Renderer<Theme>>;
|
iced_native::widget::Scrollable<'a, Message, Renderer>;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub mod toggler {
|
pub mod toggler {
|
||||||
|
|
@ -129,21 +120,19 @@ pub mod toggler {
|
||||||
pub use iced_native::widget::toggler::{Appearance, StyleSheet};
|
pub use iced_native::widget::toggler::{Appearance, StyleSheet};
|
||||||
|
|
||||||
/// A toggler widget.
|
/// A toggler widget.
|
||||||
pub type Toggler<'a, Message, Theme> =
|
pub type Toggler<'a, Message, Renderer = crate::Renderer> =
|
||||||
iced_native::widget::Toggler<'a, Message, crate::Renderer<Theme>>;
|
iced_native::widget::Toggler<'a, Message, Renderer>;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub mod text_input {
|
pub mod text_input {
|
||||||
//! Display fields that can be filled with text.
|
//! Display fields that can be filled with text.
|
||||||
//!
|
//!
|
||||||
//! A [`TextInput`] has some local [`State`].
|
//! A [`TextInput`] has some local [`State`].
|
||||||
use crate::Renderer;
|
|
||||||
|
|
||||||
pub use iced_native::widget::text_input::{Appearance, State, StyleSheet};
|
pub use iced_native::widget::text_input::{Appearance, State, StyleSheet};
|
||||||
|
|
||||||
/// A field that can be filled with text.
|
/// A field that can be filled with text.
|
||||||
pub type TextInput<'a, Message, Theme> =
|
pub type TextInput<'a, Message, Renderer = crate::Renderer> =
|
||||||
iced_native::widget::TextInput<'a, Message, Renderer<Theme>>;
|
iced_native::widget::TextInput<'a, Message, Renderer>;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub mod tooltip {
|
pub mod tooltip {
|
||||||
|
|
@ -151,8 +140,8 @@ pub mod tooltip {
|
||||||
pub use iced_native::widget::tooltip::Position;
|
pub use iced_native::widget::tooltip::Position;
|
||||||
|
|
||||||
/// A widget allowing the selection of a single value from a list of options.
|
/// A widget allowing the selection of a single value from a list of options.
|
||||||
pub type Tooltip<'a, Message, Theme> =
|
pub type Tooltip<'a, Message, Renderer = crate::Renderer> =
|
||||||
iced_native::widget::Tooltip<'a, Message, crate::Renderer<Theme>>;
|
iced_native::widget::Tooltip<'a, Message, Renderer>;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub use iced_native::widget::progress_bar;
|
pub use iced_native::widget::progress_bar;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue