diff options
author | 2022-04-27 08:49:55 -0700 | |
---|---|---|
committer | 2022-04-27 08:49:55 -0700 | |
commit | 4329f0480bec803346e7e5b8c02cc17f62b6ab35 (patch) | |
tree | 9c75b44b0d2ec0dfc824e2c46ac2438adbfd220c /native | |
parent | 6e70d9ad83432b45e6bcfd022ba31e192ad99669 (diff) | |
download | iced-4329f0480bec803346e7e5b8c02cc17f62b6ab35.tar.gz iced-4329f0480bec803346e7e5b8c02cc17f62b6ab35.tar.bz2 iced-4329f0480bec803346e7e5b8c02cc17f62b6ab35.zip |
Use top alignment instead of new layer
Diffstat (limited to 'native')
-rw-r--r-- | native/src/widget/pick_list.rs | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/native/src/widget/pick_list.rs b/native/src/widget/pick_list.rs index 4f00c96e..5ed07863 100644 --- a/native/src/widget/pick_list.rs +++ b/native/src/widget/pick_list.rs @@ -402,23 +402,20 @@ pub fn draw<T, Renderer>( if let Some(label) = label.as_ref().map(String::as_str).or_else(|| placeholder) { - renderer.with_layer(bounds, |layer| { - layer.fill_text(Text { - content: label, - size: f32::from(text_size.unwrap_or(layer.default_size())), - font: font.clone(), - color: is_selected - .then(|| style.text_color) - .unwrap_or(style.placeholder_color), - bounds: Rectangle { - x: bounds.x + f32::from(padding.left), - y: bounds.center_y(), - width: f32::INFINITY, - ..bounds - }, - horizontal_alignment: alignment::Horizontal::Left, - vertical_alignment: alignment::Vertical::Center, - }) + renderer.fill_text(Text { + content: label, + size: f32::from(text_size.unwrap_or(renderer.default_size())), + font: font.clone(), + color: is_selected + .then(|| style.text_color) + .unwrap_or(style.placeholder_color), + bounds: Rectangle { + x: bounds.x + f32::from(padding.left), + y: bounds.center_y(), + ..bounds + }, + horizontal_alignment: alignment::Horizontal::Left, + vertical_alignment: alignment::Vertical::Top, }); } } |