feat: add placeholders to pick_list

see issue #726
This commit is contained in:
Jon Pacheco 2021-05-22 19:28:17 +01:00 committed by Héctor Ramón Jiménez
parent a2b1ba522a
commit fa433743b3
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
2 changed files with 31 additions and 4 deletions

View file

@ -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),