Skip to content

Commit

Permalink
Merge pull request #1802 from casperstorm/fix/text_input_icon_misalig…
Browse files Browse the repository at this point in the history
…nment

Center `TextInput::Icon` vertically
  • Loading branch information
hecrj authored Apr 20, 2023
2 parents 477d9bd + 399a22e commit e96f26f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions native/src/widget/text_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -970,9 +970,12 @@ pub fn draw<Renderer>(
size: icon.size.unwrap_or_else(|| renderer.default_size()),
font: icon.font.clone(),
color: appearance.icon_color,
bounds: icon_layout.bounds(),
bounds: Rectangle {
y: text_bounds.center_y(),
..icon_layout.bounds()
},
horizontal_alignment: alignment::Horizontal::Left,
vertical_alignment: alignment::Vertical::Top,
vertical_alignment: alignment::Vertical::Center,
});
}

Expand Down

0 comments on commit e96f26f

Please sign in to comment.