Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Change search bar design

laurenspriemdd07cf934b61
diff --git a/mobile/apps/photos/lib/ui/viewer/search/search_suffix_icon_widget.dart b/mobile/apps/photos/lib/ui/viewer/search/search_suffix_icon_widget.dart
index 9f94bb863b..df6c64be28 100644
--- a/mobile/apps/photos/lib/ui/viewer/search/search_suffix_icon_widget.dart
+++ b/mobile/apps/photos/lib/ui/viewer/search/search_suffix_icon_widget.dart
@@ -40,6 +40,7 @@ class _SearchSuffixIconState extends State<SearchSuffixIcon> {
icon: Icon(
Icons.close,
color: colorScheme.strokeMuted,
+ size: 16,
),
),
);
diff --git a/mobile/apps/photos/lib/ui/viewer/search/search_widget.dart b/mobile/apps/photos/lib/ui/viewer/search/search_widget.dart
index 24108f09ea..2ed75afc37 100644
--- a/mobile/apps/photos/lib/ui/viewer/search/search_widget.dart
+++ b/mobile/apps/photos/lib/ui/viewer/search/search_widget.dart
@@ -3,6 +3,7 @@ import "dart:async";
import "package:ente_pure_utils/ente_pure_utils.dart";
import "package:flutter/material.dart";
import "package:flutter/scheduler.dart";
+import "package:hugeicons/hugeicons.dart";
import "package:logging/logging.dart";
import "package:photos/core/event_bus.dart";
import "package:photos/events/clear_and_unfocus_search_bar_event.dart";
@@ -141,48 +142,54 @@ class SearchWidgetState extends State<SearchWidget> {
@override
Widget build(BuildContext context) {
final colorScheme = getEnteColorScheme(context);
+ final textTheme = getEnteTextTheme(context);
+ final mutedTextColor =
+ textTheme.smallMuted.color ?? colorScheme.strokeMuted;
return RepaintBoundary(
key: widgetKey,
child: Padding(
padding: EdgeInsets.only(bottom: _bottomPadding),
child: Padding(
- padding: const EdgeInsets.symmetric(vertical: 12),
- child: Padding(
- padding: const EdgeInsets.symmetric(vertical: 2, horizontal: 8),
+ padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 12),
+ child: SizedBox(
+ height: 58,
child: ClipRRect(
- borderRadius: BorderRadius.circular(8),
- child: Container(
- color: colorScheme.backgroundBase,
- child: Container(
- color: colorScheme.fillFaint,
- child: TextField(
- controller: textController,
- focusNode: focusNode,
- style: Theme.of(context).textTheme.titleMedium,
- textAlignVertical: const TextAlignVertical(y: 0),
- // Below parameters are to disable auto-suggestion
- // Above parameters are to disable auto-suggestion
- decoration: InputDecoration(
- hintText: AppLocalizations.of(context).search,
- filled: true,
- fillColor: getEnteColorScheme(context).fillFaint,
- border: const UnderlineInputBorder(
- borderSide: BorderSide.none,
+ borderRadius: BorderRadius.circular(16),
+ child: ColoredBox(
+ color: colorScheme.fillFaint,
+ child: Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 16),
+ child: Row(
+ children: [
+ HugeIcon(
+ icon: HugeIcons.strokeRoundedSearch01,
+ color: mutedTextColor,
+ size: 24,
+ strokeWidth: 1.5,
),
- focusedBorder: const UnderlineInputBorder(
- borderSide: BorderSide.none,
- ),
- prefixIcon: Hero(
- tag: "search_icon",
- child: Icon(
- Icons.search,
- color: colorScheme.strokeFaint,
+ const SizedBox(width: 12),
+ Expanded(
+ child: TextField(
+ controller: textController,
+ focusNode: focusNode,
+ style: textTheme.small,
+ textAlignVertical: TextAlignVertical.center,
+ // Below parameters are to disable auto-suggestion
+ // Above parameters are to disable auto-suggestion
+ decoration: InputDecoration(
+ hintText: AppLocalizations.of(context).search,
+ hintStyle: textTheme.smallMuted,
+ border: InputBorder.none,
+ focusedBorder: InputBorder.none,
+ isDense: true,
+ contentPadding: EdgeInsets.zero,
+ ),
),
),
/*Using valueListenableBuilder inside a stateful widget because this widget is only rebuild when
setState is called when deboucncing is over and the spinner needs to be shown while debouncing */
- suffixIcon: ValueListenableBuilder(
+ ValueListenableBuilder(
valueListenable: isLoading,
builder: (
BuildContext context,
@@ -194,7 +201,7 @@ class SearchWidgetState extends State<SearchWidget> {
);
},
),
- ),
+ ],
),
),
),