Skip to content

armgit / ente

Public Imported from GitHub
0

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

Disable vertical padding on scrollbars in gallery that don't need vertical padding

ashilknbbcb6dc70228
diff --git a/mobile/apps/photos/lib/ui/viewer/gallery/gallery.dart b/mobile/apps/photos/lib/ui/viewer/gallery/gallery.dart
index 5298b90b84..0f46df7e3d 100644
--- a/mobile/apps/photos/lib/ui/viewer/gallery/gallery.dart
+++ b/mobile/apps/photos/lib/ui/viewer/gallery/gallery.dart
@@ -78,6 +78,7 @@ class Gallery extends StatefulWidget {
final SortAscFn? sortAsyncFn;
final GroupType groupType;
final bool disablePinnedGroupHeader;
+ final bool disableVerticalPaddingForScrollbar;
const Gallery({
required this.asyncLoader,
@@ -104,6 +105,7 @@ class Gallery extends StatefulWidget {
this.reloadDebounceExecutionInterval = const Duration(seconds: 2),
this.disablePinnedGroupHeader = false,
this.galleryType,
+ this.disableVerticalPaddingForScrollbar = false,
super.key,
});
@@ -561,8 +563,12 @@ class GalleryState extends State<Gallery> {
galleryGroups: galleryGroups,
inUseNotifier: scrollBarInUseNotifier,
heighOfViewport: MediaQuery.sizeOf(context).height,
- topPadding: groupHeaderExtent!,
- bottomPadding: scrollbarBottomPaddingNotifier,
+ topPadding: widget.disableVerticalPaddingForScrollbar
+ ? 0.0
+ : groupHeaderExtent!,
+ bottomPadding: widget.disableVerticalPaddingForScrollbar
+ ? ValueNotifier(0.0)
+ : scrollbarBottomPaddingNotifier,
child: NotificationListener<SizeChangedLayoutNotification>(
onNotification: (notification) {
final renderBox = _headerKey.currentContext
diff --git a/mobile/apps/photos/lib/ui/viewer/gallery/hooks/add_photos_sheet.dart b/mobile/apps/photos/lib/ui/viewer/gallery/hooks/add_photos_sheet.dart
index 93f54f75ea..941a29ecec 100644
--- a/mobile/apps/photos/lib/ui/viewer/gallery/hooks/add_photos_sheet.dart
+++ b/mobile/apps/photos/lib/ui/viewer/gallery/hooks/add_photos_sheet.dart
@@ -312,6 +312,7 @@ class _DelayedGalleryState extends State<DelayedGallery> {
showSelectAll: true,
sortAsyncFn: () => false,
disablePinnedGroupHeader: true,
+ disableVerticalPaddingForScrollbar: true,
).animate().fadeIn(
duration: const Duration(milliseconds: 175),
curve: Curves.easeOutCirc,
diff --git a/mobile/apps/photos/lib/ui/viewer/gallery/hooks/pick_cover_photo.dart b/mobile/apps/photos/lib/ui/viewer/gallery/hooks/pick_cover_photo.dart
index b65ef9bf53..efe36582ce 100644
--- a/mobile/apps/photos/lib/ui/viewer/gallery/hooks/pick_cover_photo.dart
+++ b/mobile/apps/photos/lib/ui/viewer/gallery/hooks/pick_cover_photo.dart
@@ -122,6 +122,7 @@ class PickCoverPhotoWidget extends StatelessWidget {
sortAsyncFn: () =>
collection.pubMagicMetadata.asc ?? false,
disablePinnedGroupHeader: true,
+ disableVerticalPaddingForScrollbar: true,
),
),
),
diff --git a/mobile/apps/photos/lib/ui/viewer/gallery/hooks/pick_person_avatar.dart b/mobile/apps/photos/lib/ui/viewer/gallery/hooks/pick_person_avatar.dart
index bdc67c5bff..ac07487730 100644
--- a/mobile/apps/photos/lib/ui/viewer/gallery/hooks/pick_person_avatar.dart
+++ b/mobile/apps/photos/lib/ui/viewer/gallery/hooks/pick_person_avatar.dart
@@ -121,6 +121,7 @@ class PickPersonCoverPhotoWidget extends StatelessWidget {
limitSelectionToOne: true,
showSelectAll: false,
disablePinnedGroupHeader: true,
+ disableVerticalPaddingForScrollbar: true,
),
),
),
diff --git a/mobile/apps/photos/lib/ui/viewer/location/pick_center_point_widget.dart b/mobile/apps/photos/lib/ui/viewer/location/pick_center_point_widget.dart
index 7d685c3fd0..292229e346 100644
--- a/mobile/apps/photos/lib/ui/viewer/location/pick_center_point_widget.dart
+++ b/mobile/apps/photos/lib/ui/viewer/location/pick_center_point_widget.dart
@@ -123,6 +123,7 @@ class PickCenterPointWidget extends StatelessWidget {
),
),
disablePinnedGroupHeader: true,
+ disableVerticalPaddingForScrollbar: true,
),
),
),