summaryrefslogtreecommitdiffstats
path: root/native/src
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-07-10 02:50:47 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-07-10 02:52:00 +0200
commit73b8ae8e5e7f57c608c775272a2980995ab22bb3 (patch)
tree1315ae257af6598389750c392b0e52fd1a3cbf39 /native/src
parent2118a726f8b6134820e1ca5b7b802fa1344e453a (diff)
downloadiced-73b8ae8e5e7f57c608c775272a2980995ab22bb3.tar.gz
iced-73b8ae8e5e7f57c608c775272a2980995ab22bb3.tar.bz2
iced-73b8ae8e5e7f57c608c775272a2980995ab22bb3.zip
Rename `ComboBox` to `PickList`
Diffstat (limited to 'native/src')
-rw-r--r--native/src/widget.rs6
-rw-r--r--native/src/widget/pick_list.rs (renamed from native/src/widget/combo_box.rs)58
2 files changed, 32 insertions, 32 deletions
diff --git a/native/src/widget.rs b/native/src/widget.rs
index 931b4739..8539e519 100644
--- a/native/src/widget.rs
+++ b/native/src/widget.rs
@@ -23,10 +23,10 @@
pub mod button;
pub mod checkbox;
pub mod column;
-pub mod combo_box;
pub mod container;
pub mod image;
pub mod pane_grid;
+pub mod pick_list;
pub mod progress_bar;
pub mod radio;
pub mod row;
@@ -44,14 +44,14 @@ pub use checkbox::Checkbox;
#[doc(no_inline)]
pub use column::Column;
#[doc(no_inline)]
-pub use combo_box::ComboBox;
-#[doc(no_inline)]
pub use container::Container;
#[doc(no_inline)]
pub use image::Image;
#[doc(no_inline)]
pub use pane_grid::PaneGrid;
#[doc(no_inline)]
+pub use pick_list::PickList;
+#[doc(no_inline)]
pub use progress_bar::ProgressBar;
#[doc(no_inline)]
pub use radio::Radio;
diff --git a/native/src/widget/combo_box.rs b/native/src/widget/pick_list.rs
index fefaf8ff..9f62e550 100644
--- a/native/src/widget/combo_box.rs
+++ b/native/src/widget/pick_list.rs
@@ -9,7 +9,7 @@ use std::borrow::Cow;
/// A widget for selecting a single value from a list of options.
#[allow(missing_debug_implementations)]
-pub struct ComboBox<'a, T, Message, Renderer: self::Renderer>
+pub struct PickList<'a, T, Message, Renderer: self::Renderer>
where
[T]: ToOwned<Owned = Vec<T>>,
{
@@ -25,25 +25,25 @@ where
is_open: bool,
}
-/// The local state of a [`ComboBox`].
+/// The local state of a [`PickList`].
///
-/// [`ComboBox`]: struct.ComboBox.html
+/// [`PickList`]: struct.PickList.html
#[derive(Debug, Clone, Default)]
pub struct State {
menu: menu::State,
}
impl<'a, T: 'a, Message, Renderer: self::Renderer>
- ComboBox<'a, T, Message, Renderer>
+ PickList<'a, T, Message, Renderer>
where
T: ToString,
[T]: ToOwned<Owned = Vec<T>>,
{
- /// Creates a new [`ComboBox`] with the given [`State`], a list of options,
+ /// Creates a new [`PickList`] with the given [`State`], a list of options,
/// the current selected value, and the message to produce when an option is
/// selected.
///
- /// [`ComboBox`]: struct.ComboBox.html
+ /// [`PickList`]: struct.PickList.html
/// [`State`]: struct.State.html
pub fn new(
state: &'a mut State,
@@ -67,41 +67,41 @@ where
}
}
- /// Sets the width of the [`ComboBox`].
+ /// Sets the width of the [`PickList`].
///
- /// [`ComboBox`]: struct.ComboBox.html
+ /// [`PickList`]: struct.PickList.html
pub fn width(mut self, width: Length) -> Self {
self.width = width;
self
}
- /// Sets the padding of the [`ComboBox`].
+ /// Sets the padding of the [`PickList`].
///
- /// [`ComboBox`]: struct.ComboBox.html
+ /// [`PickList`]: struct.PickList.html
pub fn padding(mut self, padding: u16) -> Self {
self.padding = padding;
self
}
- /// Sets the text size of the [`ComboBox`].
+ /// Sets the text size of the [`PickList`].
///
- /// [`ComboBox`]: struct.ComboBox.html
+ /// [`PickList`]: struct.PickList.html
pub fn text_size(mut self, size: u16) -> Self {
self.text_size = Some(size);
self
}
- /// Sets the font of the [`ComboBox`].
+ /// Sets the font of the [`PickList`].
///
- /// [`ComboBox`]: struct.ComboBox.html
+ /// [`PickList`]: struct.PickList.html
pub fn font(mut self, font: Renderer::Font) -> Self {
self.font = font;
self
}
- /// Sets the style of the [`ComboBox`].
+ /// Sets the style of the [`PickList`].
///
- /// [`ComboBox`]: struct.ComboBox.html
+ /// [`PickList`]: struct.PickList.html
pub fn style(
mut self,
style: impl Into<<Renderer as self::Renderer>::Style>,
@@ -112,7 +112,7 @@ where
}
impl<'a, T: 'a, Message, Renderer> Widget<Message, Renderer>
- for ComboBox<'a, T, Message, Renderer>
+ for PickList<'a, T, Message, Renderer>
where
T: Clone + ToString + Eq,
[T]: ToOwned<Owned = Vec<T>>,
@@ -265,35 +265,35 @@ where
}
}
-/// The renderer of a [`ComboBox`].
+/// The renderer of a [`PickList`].
///
/// Your [renderer] will need to implement this trait before being
-/// able to use a [`ComboBox`] in your user interface.
+/// able to use a [`PickList`] in your user interface.
///
-/// [`ComboBox`]: struct.ComboBox.html
+/// [`PickList`]: struct.PickList.html
/// [renderer]: ../../renderer/index.html
pub trait Renderer: text::Renderer + menu::Renderer {
- /// The default padding of a [`ComboBox`].
+ /// The default padding of a [`PickList`].
///
- /// [`ComboBox`]: struct.ComboBox.html
+ /// [`PickList`]: struct.PickList.html
const DEFAULT_PADDING: u16;
- /// The [`ComboBox`] style supported by this renderer.
+ /// The [`PickList`] style supported by this renderer.
///
- /// [`ComboBox`]: struct.ComboBox.html
+ /// [`PickList`]: struct.PickList.html
type Style: Default;
- /// Returns the style of the [`Menu`] of the [`ComboBox`].
+ /// Returns the style of the [`Menu`] of the [`PickList`].
///
/// [`Menu`]: ../../overlay/menu/struct.Menu.html
- /// [`ComboBox`]: struct.ComboBox.html
+ /// [`PickList`]: struct.PickList.html
fn menu_style(
style: &<Self as Renderer>::Style,
) -> <Self as menu::Renderer>::Style;
- /// Draws a [`ComboBox`].
+ /// Draws a [`PickList`].
///
- /// [`ComboBox`]: struct.ComboBox.html
+ /// [`PickList`]: struct.PickList.html
fn draw(
&mut self,
bounds: Rectangle,
@@ -307,7 +307,7 @@ pub trait Renderer: text::Renderer + menu::Renderer {
}
impl<'a, T: 'a, Message, Renderer> Into<Element<'a, Message, Renderer>>
- for ComboBox<'a, T, Message, Renderer>
+ for PickList<'a, T, Message, Renderer>
where
T: Clone + ToString + Eq,
[T]: ToOwned<Owned = Vec<T>>,