diff options
| author | 2023-04-20 15:30:09 +0200 | |
|---|---|---|
| committer | 2023-04-20 15:30:09 +0200 | |
| commit | e96f26f3574997e4b268cf360fe84b7783e960f7 (patch) | |
| tree | 7183f6f46a54791c28603656798a01a2472a9149 /native/src/widget | |
| parent | 477d9bd6ad0f6653f270e624eb4d31683779dc0a (diff) | |
| parent | 399a22e61d8b3c265be636aab3645aba62dd5c89 (diff) | |
| download | iced-e96f26f3574997e4b268cf360fe84b7783e960f7.tar.gz iced-e96f26f3574997e4b268cf360fe84b7783e960f7.tar.bz2 iced-e96f26f3574997e4b268cf360fe84b7783e960f7.zip | |
Merge pull request #1802 from casperstorm/fix/text_input_icon_misalignment
Center `TextInput::Icon` vertically
Diffstat (limited to 'native/src/widget')
| -rw-r--r-- | native/src/widget/text_input.rs | 7 | 
1 files changed, 5 insertions, 2 deletions
| diff --git a/native/src/widget/text_input.rs b/native/src/widget/text_input.rs index 8627aa98..6113cf94 100644 --- a/native/src/widget/text_input.rs +++ b/native/src/widget/text_input.rs @@ -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,          });      } | 
