Browse Source

Use small font when photoGridSize > 5

Neeraj Gupta 2 years ago
parent
commit
379db6701a
2 changed files with 5 additions and 2 deletions
  1. 1 0
      lib/ui/huge_listview/lazy_loading_gallery.dart
  2. 4 2
      lib/utils/date_time_util.dart

+ 1 - 0
lib/ui/huge_listview/lazy_loading_gallery.dart

@@ -193,6 +193,7 @@ class _LazyLoadingGalleryState extends State<LazyLoadingGallery> {
               child: getDayWidget(
                 context,
                 _files[0].creationTime,
+                widget.photoGirdSize,
               ),
             ),
             ValueListenableBuilder(

+ 4 - 2
lib/utils/date_time_util.dart

@@ -195,16 +195,18 @@ bool isLeapYear(DateTime dateTime) {
 Widget getDayWidget(
   BuildContext context,
   int timestamp,
+  int photoGridSize,
 ) {
   final colorScheme = getEnteColorScheme(context);
   final textTheme = getEnteTextTheme(context);
+  final textStyle = photoGridSize < 6 ? textTheme.body : textTheme.small;
   return Container(
     alignment: Alignment.centerLeft,
     child: Text(
       getDayTitle(timestamp),
       style: (getDayTitle(timestamp) == "Today")
-          ? textTheme.body
-          : textTheme.body.copyWith(color: colorScheme.textMuted),
+          ? textStyle
+          : textStyle.copyWith(color: colorScheme.textMuted),
     ),
   );
 }