From afd9274de26ccf65285df02007b4ddb697bea9a3 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sat, 18 Apr 2020 14:42:48 +0200 Subject: Draft `ComboBox` and `Menu` layer --- glow/src/lib.rs | 2 +- glow/src/widget.rs | 3 +++ glow/src/widget/combo_box.rs | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 glow/src/widget/combo_box.rs (limited to 'glow') diff --git a/glow/src/lib.rs b/glow/src/lib.rs index a6c8a75a..bdd854e3 100644 --- a/glow/src/lib.rs +++ b/glow/src/lib.rs @@ -2,7 +2,7 @@ //! //! [`glow`]: https://github.com/grovesNL/glow //! [`iced_native`]: https://github.com/hecrj/iced/tree/master/native -#![deny(missing_docs)] +//#![deny(missing_docs)] #![deny(missing_debug_implementations)] #![deny(unused_results)] #![forbid(rust_2018_idioms)] diff --git a/glow/src/widget.rs b/glow/src/widget.rs index 9968092b..c8f16725 100644 --- a/glow/src/widget.rs +++ b/glow/src/widget.rs @@ -11,6 +11,7 @@ use crate::Renderer; pub mod button; pub mod checkbox; +pub mod combo_box; pub mod container; pub mod pane_grid; pub mod progress_bar; @@ -24,6 +25,8 @@ pub use button::Button; #[doc(no_inline)] pub use checkbox::Checkbox; #[doc(no_inline)] +pub use combo_box::ComboBox; +#[doc(no_inline)] pub use container::Container; #[doc(no_inline)] pub use pane_grid::PaneGrid; diff --git a/glow/src/widget/combo_box.rs b/glow/src/widget/combo_box.rs new file mode 100644 index 00000000..bb3931ef --- /dev/null +++ b/glow/src/widget/combo_box.rs @@ -0,0 +1,3 @@ +pub use iced_native::combo_box::State; + +pub type ComboBox<'a, T, Message> = iced_native::ComboBox<'a, T, Message>; -- cgit From e29feef8ba4f95f286039fcc1ca2e53bfe5019c5 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sat, 18 Apr 2020 19:53:27 +0200 Subject: Render arrow icon in `ComboBox` --- glow/src/backend.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'glow') diff --git a/glow/src/backend.rs b/glow/src/backend.rs index 8b5b4f9c..e1685816 100644 --- a/glow/src/backend.rs +++ b/glow/src/backend.rs @@ -193,6 +193,7 @@ impl iced_graphics::Backend for Backend { impl backend::Text for Backend { const ICON_FONT: Font = font::ICONS; const CHECKMARK_ICON: char = font::CHECKMARK_ICON; + const ARROW_DOWN_ICON: char = font::ARROW_DOWN_ICON; fn default_size(&self) -> u16 { self.default_text_size -- cgit From 61f22b1db23f3495145a9a4f7255311fe8381998 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 11 Jun 2020 20:41:11 +0200 Subject: Add styling support for `ComboBox` and `Menu` --- glow/src/widget/combo_box.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'glow') diff --git a/glow/src/widget/combo_box.rs b/glow/src/widget/combo_box.rs index bb3931ef..bfface29 100644 --- a/glow/src/widget/combo_box.rs +++ b/glow/src/widget/combo_box.rs @@ -1,3 +1,8 @@ pub use iced_native::combo_box::State; -pub type ComboBox<'a, T, Message> = iced_native::ComboBox<'a, T, Message>; +pub use iced_graphics::combo_box::{Style, StyleSheet}; +pub use iced_graphics::overlay::menu::Style as Menu; + +/// A widget allowing the selection of a single value from a list of options. +pub type ComboBox<'a, T, Message> = + iced_native::ComboBox<'a, T, Message, crate::Renderer>; -- cgit From 2118a726f8b6134820e1ca5b7b802fa1344e453a Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Fri, 10 Jul 2020 02:39:12 +0200 Subject: Write documentation for the new `overlay` API --- glow/src/lib.rs | 2 +- glow/src/widget/combo_box.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'glow') diff --git a/glow/src/lib.rs b/glow/src/lib.rs index bdd854e3..a6c8a75a 100644 --- a/glow/src/lib.rs +++ b/glow/src/lib.rs @@ -2,7 +2,7 @@ //! //! [`glow`]: https://github.com/grovesNL/glow //! [`iced_native`]: https://github.com/hecrj/iced/tree/master/native -//#![deny(missing_docs)] +#![deny(missing_docs)] #![deny(missing_debug_implementations)] #![deny(unused_results)] #![forbid(rust_2018_idioms)] diff --git a/glow/src/widget/combo_box.rs b/glow/src/widget/combo_box.rs index bfface29..20feeaca 100644 --- a/glow/src/widget/combo_box.rs +++ b/glow/src/widget/combo_box.rs @@ -1,3 +1,4 @@ +//! Display a dropdown list of selectable values. pub use iced_native::combo_box::State; pub use iced_graphics::combo_box::{Style, StyleSheet}; -- cgit From 73b8ae8e5e7f57c608c775272a2980995ab22bb3 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Fri, 10 Jul 2020 02:50:47 +0200 Subject: Rename `ComboBox` to `PickList` --- glow/src/widget.rs | 6 +++--- glow/src/widget/combo_box.rs | 9 --------- glow/src/widget/pick_list.rs | 9 +++++++++ 3 files changed, 12 insertions(+), 12 deletions(-) delete mode 100644 glow/src/widget/combo_box.rs create mode 100644 glow/src/widget/pick_list.rs (limited to 'glow') diff --git a/glow/src/widget.rs b/glow/src/widget.rs index c8f16725..4e2fedc5 100644 --- a/glow/src/widget.rs +++ b/glow/src/widget.rs @@ -11,9 +11,9 @@ use crate::Renderer; pub mod button; pub mod checkbox; -pub mod combo_box; pub mod container; pub mod pane_grid; +pub mod pick_list; pub mod progress_bar; pub mod radio; pub mod scrollable; @@ -25,12 +25,12 @@ pub use button::Button; #[doc(no_inline)] pub use checkbox::Checkbox; #[doc(no_inline)] -pub use combo_box::ComboBox; -#[doc(no_inline)] pub use container::Container; #[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/glow/src/widget/combo_box.rs b/glow/src/widget/combo_box.rs deleted file mode 100644 index 20feeaca..00000000 --- a/glow/src/widget/combo_box.rs +++ /dev/null @@ -1,9 +0,0 @@ -//! Display a dropdown list of selectable values. -pub use iced_native::combo_box::State; - -pub use iced_graphics::combo_box::{Style, StyleSheet}; -pub use iced_graphics::overlay::menu::Style as Menu; - -/// A widget allowing the selection of a single value from a list of options. -pub type ComboBox<'a, T, Message> = - iced_native::ComboBox<'a, T, Message, crate::Renderer>; diff --git a/glow/src/widget/pick_list.rs b/glow/src/widget/pick_list.rs new file mode 100644 index 00000000..fccc68c9 --- /dev/null +++ b/glow/src/widget/pick_list.rs @@ -0,0 +1,9 @@ +//! Display a dropdown list of selectable values. +pub use iced_native::pick_list::State; + +pub use iced_graphics::overlay::menu::Style as Menu; +pub use iced_graphics::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_native::PickList<'a, T, Message, crate::Renderer>; -- cgit