Merge pull request #1802 from casperstorm/fix/text_input_icon_misalignment
Center `TextInput::Icon` vertically
This commit is contained in:
commit
e96f26f357
1 changed files with 5 additions and 2 deletions
|
|
@ -970,9 +970,12 @@ pub fn draw<Renderer>(
|
||||||
size: icon.size.unwrap_or_else(|| renderer.default_size()),
|
size: icon.size.unwrap_or_else(|| renderer.default_size()),
|
||||||
font: icon.font.clone(),
|
font: icon.font.clone(),
|
||||||
color: appearance.icon_color,
|
color: appearance.icon_color,
|
||||||
bounds: icon_layout.bounds(),
|
bounds: Rectangle {
|
||||||
|
y: text_bounds.center_y(),
|
||||||
|
..icon_layout.bounds()
|
||||||
|
},
|
||||||
horizontal_alignment: alignment::Horizontal::Left,
|
horizontal_alignment: alignment::Horizontal::Left,
|
||||||
vertical_alignment: alignment::Vertical::Top,
|
vertical_alignment: alignment::Vertical::Center,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue