From c0b4a3e0cbbe394d94271f1b2c429cb656445c2d Mon Sep 17 00:00:00 2001 From: Lukas Klingsbo Date: Mon, 7 Oct 2024 10:19:18 +0200 Subject: [PATCH] fix: Height of search fields should be static (#1833) [Screencast from 2024-10-04 16-31-39.webm](https://github.com/user-attachments/assets/85998e6a-e416-46af-a10a-7d745a5e9f0d) Fixes: #1832 --- packages/app_center/lib/constants.dart | 2 +- packages/app_center/lib/manage/manage_page.dart | 3 ++- packages/app_center/lib/search/search_field.dart | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/app_center/lib/constants.dart b/packages/app_center/lib/constants.dart index 93e5bf2fc..db73fc941 100644 --- a/packages/app_center/lib/constants.dart +++ b/packages/app_center/lib/constants.dart @@ -18,5 +18,5 @@ const kSearchFieldIconConstraints = BoxConstraints( maxWidth: 32, maxHeight: 32, ); -const kSearchFieldStrutStyle = StrutStyle(leading: 0.2); +const kSearchFieldContentPadding = EdgeInsets.all(12); const kSearchFieldPrefixIcon = Icon(YaruIcons.search, size: 16); diff --git a/packages/app_center/lib/manage/manage_page.dart b/packages/app_center/lib/manage/manage_page.dart index 90ddc0a4d..444534a47 100644 --- a/packages/app_center/lib/manage/manage_page.dart +++ b/packages/app_center/lib/manage/manage_page.dart @@ -179,10 +179,11 @@ class ManagePage extends ConsumerWidget { // here and the `SearchField` widget child: TextFormField( style: Theme.of(context).textTheme.bodyMedium, - strutStyle: kSearchFieldStrutStyle, textAlignVertical: TextAlignVertical.center, cursorWidth: 1, decoration: InputDecoration( + isDense: true, + contentPadding: kSearchFieldContentPadding, prefixIcon: kSearchFieldPrefixIcon, prefixIconConstraints: kSearchFieldIconConstraints, hintText: l10n.managePageSearchFieldSearchHint, diff --git a/packages/app_center/lib/search/search_field.dart b/packages/app_center/lib/search/search_field.dart index 09769ad99..2789d21c2 100644 --- a/packages/app_center/lib/search/search_field.dart +++ b/packages/app_center/lib/search/search_field.dart @@ -168,7 +168,6 @@ class _SearchFieldState extends ConsumerState { return TextField( style: Theme.of(context).textTheme.bodyMedium, - strutStyle: kSearchFieldStrutStyle, textAlignVertical: TextAlignVertical.center, cursorWidth: 1, focusNode: node, @@ -178,7 +177,8 @@ class _SearchFieldState extends ConsumerState { ? onFieldSubmitted() : widget.onSearch(query), decoration: InputDecoration( - contentPadding: const EdgeInsets.fromLTRB(12, 8, 12, 8), + isDense: true, + contentPadding: kSearchFieldContentPadding, prefixIcon: kSearchFieldPrefixIcon, prefixIconConstraints: kSearchFieldIconConstraints, hintText: l10n.searchFieldSearchHint,