diff options
| author | 2023-04-20 12:17:11 +0200 | |
|---|---|---|
| committer | 2023-04-20 12:17:11 +0200 | |
| commit | 399a22e61d8b3c265be636aab3645aba62dd5c89 (patch) | |
| tree | 1f4a44a8cffa46414f687d17bbf52d56d20acf7d /native/src | |
| parent | 4b05f42fd6d18bf572b772dd60d6a4309ea5f343 (diff) | |
| download | iced-399a22e61d8b3c265be636aab3645aba62dd5c89.tar.gz iced-399a22e61d8b3c265be636aab3645aba62dd5c89.tar.bz2 iced-399a22e61d8b3c265be636aab3645aba62dd5c89.zip  | |
Centered icon vertically
Diffstat (limited to '')
| -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,          });      }  | 
