From 9bfb1599773bfc74d5f112445ed1ab9df561081f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vuka=C5=A1in=20Vojinovi=C4=87?= Date: Sat, 21 Sep 2024 18:44:44 +0200 Subject: [PATCH] fix(text_input): make icon padding fixed This prevents the icons from becoming too large or too small relative to the input box, that leads to visual issues. --- src/widget/text_input/input.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/widget/text_input/input.rs b/src/widget/text_input/input.rs index eaf633a4..343ae80d 100644 --- a/src/widget/text_input/input.rs +++ b/src/widget/text_input/input.rs @@ -107,7 +107,7 @@ where crate::widget::icon::from_name("system-search-symbolic") .size(16) .apply(crate::widget::container) - .padding([spacing, spacing, spacing, spacing]) + .padding(8) .into(), ) } @@ -131,7 +131,7 @@ where crate::widget::icon::from_name("system-lock-screen-symbolic") .size(16) .apply(crate::widget::container) - .padding([spacing, spacing, spacing, spacing]) + .padding(8) .into(), ); if hidden { @@ -148,7 +148,7 @@ where .apply(crate::widget::button::custom) .style(crate::theme::Button::Icon) .on_press(msg) - .padding([spacing, spacing, spacing, spacing]) + .padding(8) .into(), ) } else { @@ -496,17 +496,13 @@ where } pub fn on_clear(self, on_clear: Message) -> Self { - let spacing = THEME.lock().unwrap().cosmic().space_xxs(); - self.trailing_icon( crate::widget::icon::from_name("edit-clear-symbolic") .size(16) .apply(crate::widget::button::custom) .style(crate::theme::Button::Icon) - .width(32) - .height(32) .on_press(on_clear) - .padding([spacing, spacing, spacing, spacing]) + .padding(8) .into(), ) }