diff options
author | 2021-05-22 19:28:17 +0100 | |
---|---|---|
committer | 2021-07-22 19:12:56 +0700 | |
commit | fa433743b352f9a27e0669d4da41f645db8b04cb (patch) | |
tree | e384f5db7a9ffbed5c7b7afd6ace68544c67c850 /graphics | |
parent | a2b1ba522a8b90a2e539fff5936c798efc3f3807 (diff) | |
download | iced-fa433743b352f9a27e0669d4da41f645db8b04cb.tar.gz iced-fa433743b352f9a27e0669d4da41f645db8b04cb.tar.bz2 iced-fa433743b352f9a27e0669d4da41f645db8b04cb.zip |
feat: add placeholders to pick_list
see issue #726
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/src/widget/pick_list.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/graphics/src/widget/pick_list.rs b/graphics/src/widget/pick_list.rs index 32dfbdf9..a7fe3e93 100644 --- a/graphics/src/widget/pick_list.rs +++ b/graphics/src/widget/pick_list.rs @@ -31,6 +31,7 @@ where bounds: Rectangle, cursor_position: Point, selected: Option<String>, + placeholder: Option<String>, padding: Padding, text_size: u16, font: Font, @@ -68,7 +69,7 @@ where ( Primitive::Group { - primitives: if let Some(label) = selected { + primitives: if let Some(label) = selected.or(placeholder) { let label = Primitive::Text { content: label, size: f32::from(text_size), |