π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Do not show scrollbar for small galleries
ashilknb305d3c9bf68
diff --git a/mobile/apps/photos/lib/ui/viewer/gallery/scrollbar/custom_scroll_bar.dart b/mobile/apps/photos/lib/ui/viewer/gallery/scrollbar/custom_scroll_bar.dartindex 99ca79b11f..1736f47680 100644--- a/mobile/apps/photos/lib/ui/viewer/gallery/scrollbar/custom_scroll_bar.dart+++ b/mobile/apps/photos/lib/ui/viewer/gallery/scrollbar/custom_scroll_bar.dart@@ -52,6 +52,7 @@ class _CustomScrollBarState extends State<CustomScrollBar> {double? heightOfScrollbarDivider;double? heightOfScrollTrack;late bool _showScrollbarDivisions;+ late bool _showThumb;// Scrollbar's heigh is not fixed by default. If the scrollable is short// enough, the scrollbar's height can go above the minimum length.@@ -89,6 +90,13 @@ class _CustomScrollBarState extends State<CustomScrollBar> {_showScrollbarDivisions = false;}+ if (widget.galleryGroups.groupLayouts.last.maxOffset >+ widget.heighOfViewport * 3) {+ _showThumb = true;+ } else {+ _showThumb = false;+ }+if (_showScrollbarDivisions) {getIntrinsicSizeOfWidget(const ScrollBarDivider(title: "Temp"), context).then((size) {@@ -223,6 +231,9 @@ class _CustomScrollBarState extends State<CustomScrollBar> {interactive: true,inUseNotifier: widget.inUseNotifier,minScrollbarLength: _kScrollbarMinLength,+ showThumb: _showThumb,+ // radius: const Radius.circular(4),+ // thickness: 8,child: widget.child,),),diff --git a/mobile/apps/photos/lib/ui/viewer/gallery/scrollbar/scroll_bar_with_use_notifier.dart b/mobile/apps/photos/lib/ui/viewer/gallery/scrollbar/scroll_bar_with_use_notifier.dartindex 75551b6d54..56e656974f 100644--- a/mobile/apps/photos/lib/ui/viewer/gallery/scrollbar/scroll_bar_with_use_notifier.dart+++ b/mobile/apps/photos/lib/ui/viewer/gallery/scrollbar/scroll_bar_with_use_notifier.dart@@ -8,7 +8,6 @@import 'package:flutter/cupertino.dart';import 'package:flutter/gestures.dart';import "package:flutter/material.dart";-import "package:photos/ui/viewer/gallery/scrollbar/cupertino_scroll_bar_with_use_notifier.dart";const double _kScrollbarThickness = 8.0;const double _kScrollbarThicknessWithTrack = 12.0;@@ -96,6 +95,7 @@ class ScrollbarWithUseNotifer extends StatelessWidget {this.notificationPredicate,this.interactive,this.scrollbarOrientation,+ this.showThumb,});/// {@macro flutter.widgets.Scrollbar.child}@@ -155,25 +155,10 @@ class ScrollbarWithUseNotifer extends StatelessWidget {final double minScrollbarLength;+ final bool? showThumb;+@overrideWidget build(BuildContext context) {- if (Theme.of(context).platform == TargetPlatform.iOS) {- return CupertinoScrollbarWithUseNotifier(- thumbVisibility: thumbVisibility ?? false,- thickness: thickness ?? CupertinoScrollbar.defaultThickness,- thicknessWhileDragging:- thickness ?? CupertinoScrollbar.defaultThicknessWhileDragging,- radius: radius ?? CupertinoScrollbar.defaultRadius,- radiusWhileDragging:- radius ?? CupertinoScrollbar.defaultRadiusWhileDragging,- controller: controller,- notificationPredicate: notificationPredicate,- scrollbarOrientation: scrollbarOrientation,- inUseNotifier: inUseNotifier,- minScrollbarLength: minScrollbarLength,- child: child,- );- }return _MaterialScrollbar(controller: controller,thumbVisibility: thumbVisibility,@@ -185,6 +170,7 @@ class ScrollbarWithUseNotifer extends StatelessWidget {scrollbarOrientation: scrollbarOrientation,inUseNotifier: inUseNotifier,minScrollbarLength: minScrollbarLength,+ showThumb: showThumb,child: child,);}@@ -193,10 +179,12 @@ class ScrollbarWithUseNotifer extends StatelessWidget {class _MaterialScrollbar extends RawScrollbar {final ValueNotifier<bool> inUseNotifier;final double minScrollbarLength;+ final bool? showThumb;const _MaterialScrollbar({required super.child,required this.inUseNotifier,required this.minScrollbarLength,+ required this.showThumb,super.controller,super.thumbVisibility,super.trackVisibility,@@ -251,6 +239,9 @@ class _MaterialScrollbarState extends RawScrollbarState<_MaterialScrollbar> {};MaterialStateProperty<Color> get _thumbColor {+ if (widget.showThumb == false) {+ return MaterialStateProperty.all(const Color(0x00000000));+ }final Color onSurface = _colorScheme.onSurface;final Brightness brightness = _colorScheme.brightness;late Color dragColor;@@ -291,6 +282,9 @@ class _MaterialScrollbarState extends RawScrollbarState<_MaterialScrollbar> {}MaterialStateProperty<Color> get _trackColor {+ if (widget.showThumb == false) {+ return MaterialStateProperty.all(const Color(0x00000000));+ }final Color onSurface = _colorScheme.onSurface;final Brightness brightness = _colorScheme.brightness;return MaterialStateProperty.resolveWith((Set<MaterialState> states) {@@ -306,6 +300,9 @@ class _MaterialScrollbarState extends RawScrollbarState<_MaterialScrollbar> {}MaterialStateProperty<Color> get _trackBorderColor {+ if (widget.showThumb == false) {+ return MaterialStateProperty.all(const Color(0x00000000));+ }final Color onSurface = _colorScheme.onSurface;final Brightness brightness = _colorScheme.brightness;return MaterialStateProperty.resolveWith((Set<MaterialState> states) {