Skip to content

Commit

Permalink
fix: Height of search fields should be static (#1833)
Browse files Browse the repository at this point in the history
  • Loading branch information
spydon authored Oct 7, 2024
1 parent 6d89565 commit c0b4a3e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/app_center/lib/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
3 changes: 2 additions & 1 deletion packages/app_center/lib/manage/manage_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions packages/app_center/lib/search/search_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ class _SearchFieldState extends ConsumerState<SearchField> {

return TextField(
style: Theme.of(context).textTheme.bodyMedium,
strutStyle: kSearchFieldStrutStyle,
textAlignVertical: TextAlignVertical.center,
cursorWidth: 1,
focusNode: node,
Expand All @@ -178,7 +177,8 @@ class _SearchFieldState extends ConsumerState<SearchField> {
? 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,
Expand Down

0 comments on commit c0b4a3e

Please sign in to comment.