Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mob][photos] Fix filters getting squished a bit because of it's size constrain and it's outer stroke width

ashilkn37f2b9f70e3b
diff --git a/mobile/lib/ui/viewer/gallery/gallery_app_bar_widget.dart b/mobile/lib/ui/viewer/gallery/gallery_app_bar_widget.dart
index d0c2b7853d..ee25c311bd 100644
--- a/mobile/lib/ui/viewer/gallery/gallery_app_bar_widget.dart
+++ b/mobile/lib/ui/viewer/gallery/gallery_app_bar_widget.dart
@@ -153,7 +153,8 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
centerTitle: false,
title: isSearching
? const SizedBox(
- height: kFilterChipHeight,
+ // +1 to account for the filter's outer stroke width
+ height: kFilterChipHeight + 1,
child: AppliedFilters(),
)
: Text(
diff --git a/mobile/lib/ui/viewer/hierarchicial_search/filter_chip.dart b/mobile/lib/ui/viewer/hierarchicial_search/filter_chip.dart
index b7b4b0b51d..2ead8d9b3a 100644
--- a/mobile/lib/ui/viewer/hierarchicial_search/filter_chip.dart
+++ b/mobile/lib/ui/viewer/hierarchicial_search/filter_chip.dart
@@ -58,7 +58,8 @@ class _GenericFilterChipState extends State<GenericFilterChip> {
clipBehavior: Clip.none,
children: [
SizedBox(
- height: kFilterChipHeight,
+ // +1 to account for the filter's outer stroke width
+ height: kFilterChipHeight + 1,
child: Container(
decoration: BoxDecoration(
color: getEnteColorScheme(context).fillFaint,
@@ -195,69 +196,64 @@ class _FaceFilterChipState extends State<FaceFilterChip> {
_isApplied = !_isApplied;
});
},
- child: SizedBox(
- height: kFilterChipHeight * scale,
- child: Container(
- decoration: BoxDecoration(
- color: getEnteColorScheme(context).fillFaint,
- borderRadius: BorderRadius.all(
- Radius.circular(kFilterChipHeight * scale / 2),
- ),
- border: Border.all(
- color: widget.isInAllFiltersView
- ? getEnteColorScheme(context).strokeMuted
- : getEnteColorScheme(context).strokeFaint,
- width: widget.isInAllFiltersView ? 1 : 0.5,
- ),
+ child: Container(
+ decoration: BoxDecoration(
+ color: getEnteColorScheme(context).fillFaint,
+ borderRadius: BorderRadius.all(
+ Radius.circular(kFilterChipHeight * scale / 2),
),
- child: Padding(
- padding: EdgeInsets.only(
- right: !widget.isInAllFiltersView && widget.name.isNotEmpty
- ? 8.0
- : 0,
- ),
- child: Row(
- mainAxisSize: MainAxisSize.min,
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- ClipOval(
- child: SizedBox(
- width: kFilterChipHeight * scale,
- height: kFilterChipHeight * scale,
- child: PersonFaceWidget(
- widget.faceThumbnailFile,
- personId: widget.personId,
- clusterID: widget.clusterId,
- thumbnailFallback: false,
- ),
+ border: Border.all(
+ color: getEnteColorScheme(context).strokeFaint,
+ width: widget.isInAllFiltersView ? 1 : 0.5,
+ ),
+ ),
+ child: Padding(
+ padding: EdgeInsets.only(
+ right: !widget.isInAllFiltersView && widget.name.isNotEmpty
+ ? 8.0
+ : 0,
+ ),
+ child: Row(
+ mainAxisSize: MainAxisSize.min,
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ ClipOval(
+ child: SizedBox(
+ width: kFilterChipHeight * scale,
+ height: kFilterChipHeight * scale,
+ child: PersonFaceWidget(
+ widget.faceThumbnailFile,
+ personId: widget.personId,
+ clusterID: widget.clusterId,
+ thumbnailFallback: false,
),
),
- !widget.isInAllFiltersView && widget.name.isNotEmpty
- ? Padding(
- padding: const EdgeInsets.symmetric(horizontal: 4),
- child: Text(
- widget.name,
- style: getEnteTextTheme(context).miniBold,
- ),
- )
- : const SizedBox.shrink(),
- _isApplied && !widget.isInAllFiltersView
- ? const SizedBox(width: 4)
- : const SizedBox.shrink(),
- _isApplied && !widget.isInAllFiltersView
- ? Icon(
- Icons.close_rounded,
- size: 16,
- color: getEnteColorScheme(context).textMuted,
- )
- : const SizedBox.shrink(),
- _isApplied &&
- widget.name.isEmpty &&
- !widget.isInAllFiltersView
- ? const SizedBox(width: 8)
- : const SizedBox.shrink(),
- ],
- ),
+ ),
+ !widget.isInAllFiltersView && widget.name.isNotEmpty
+ ? Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 4),
+ child: Text(
+ widget.name,
+ style: getEnteTextTheme(context).miniBold,
+ ),
+ )
+ : const SizedBox.shrink(),
+ _isApplied && !widget.isInAllFiltersView
+ ? const SizedBox(width: 4)
+ : const SizedBox.shrink(),
+ _isApplied && !widget.isInAllFiltersView
+ ? Icon(
+ Icons.close_rounded,
+ size: 16,
+ color: getEnteColorScheme(context).textMuted,
+ )
+ : const SizedBox.shrink(),
+ _isApplied &&
+ widget.name.isEmpty &&
+ !widget.isInAllFiltersView
+ ? const SizedBox(width: 8)
+ : const SizedBox.shrink(),
+ ],
),
),
),
diff --git a/mobile/lib/ui/viewer/hierarchicial_search/recommended_filters.dart b/mobile/lib/ui/viewer/hierarchicial_search/recommended_filters.dart
index ad7fafa457..c222ecff88 100644
--- a/mobile/lib/ui/viewer/hierarchicial_search/recommended_filters.dart
+++ b/mobile/lib/ui/viewer/hierarchicial_search/recommended_filters.dart
@@ -62,7 +62,8 @@ class _RecommendedFiltersState extends State<RecommendedFilters> {
return Padding(
padding: const EdgeInsets.only(bottom: 8),
child: SizedBox(
- height: kFilterChipHeight,
+ // +1 to account for the filter's outer stroke width
+ height: kFilterChipHeight + 1,
child: AnimatedSwitcher(
duration: const Duration(milliseconds: 500),
switchInCurve: Curves.easeInOutExpo,
diff --git a/mobile/lib/ui/viewer/people/people_app_bar.dart b/mobile/lib/ui/viewer/people/people_app_bar.dart
index 70b46ad721..a5dd615441 100644
--- a/mobile/lib/ui/viewer/people/people_app_bar.dart
+++ b/mobile/lib/ui/viewer/people/people_app_bar.dart
@@ -106,7 +106,8 @@ class _AppBarWidgetState extends State<PeopleAppBar> {
centerTitle: false,
title: isSearching
? const SizedBox(
- height: kFilterChipHeight,
+ // +1 to account for the filter's outer stroke width
+ height: kFilterChipHeight + 1,
child: AppliedFilters(),
)
: Text(