From c03e72c1da810979e820e7922996f969941dc852 Mon Sep 17 00:00:00 2001 From: JobiJoba <6494791+JobiJoba@users.noreply.github.com> Date: Tue, 10 Jun 2025 22:22:42 +0700 Subject: [PATCH] feat(mobile): Add Scrollbar for vertical scrolling on the actions button multi-select (#18940) * feat(mobile): Add Scrollbar for vertical scrolling on the actions button of a selected asset. * fixed error scroll position and add more space for the scrollbar * revert scrollbar change and display always 5.5 icons button * minWidth set to 5.5 and used * fix: logic and fine tuning --------- Co-authored-by: Alex --- .../widgets/asset_grid/control_bottom_app_bar.dart | 13 +++++-------- mobile/lib/widgets/common/drag_sheet.dart | 5 ++++- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/mobile/lib/widgets/asset_grid/control_bottom_app_bar.dart b/mobile/lib/widgets/asset_grid/control_bottom_app_bar.dart index 309de3ae28..3859e5ec1b 100644 --- a/mobile/lib/widgets/asset_grid/control_bottom_app_bar.dart +++ b/mobile/lib/widgets/asset_grid/control_bottom_app_bar.dart @@ -80,7 +80,7 @@ class ControlBottomAppBar extends HookConsumerWidget { final albums = ref.watch(albumProvider).where((a) => a.isRemote).toList(); final sharedAlbums = ref.watch(albumProvider).where((a) => a.shared).toList(); - const bottomPadding = 0.20; + const bottomPadding = 0.24; final scrollController = useDraggableScrollController(); final isInLockedView = ref.watch(inLockedViewProvider); @@ -314,7 +314,7 @@ class ControlBottomAppBar extends HookConsumerWidget { getInitialSize() { if (isInLockedView) { - return 0.20; + return bottomPadding; } if (hasRemote) { return 0.35; @@ -324,7 +324,7 @@ class ControlBottomAppBar extends HookConsumerWidget { getMaxChildSize() { if (isInLockedView) { - return 0.20; + return bottomPadding; } if (hasRemote) { return 0.65; @@ -333,15 +333,12 @@ class ControlBottomAppBar extends HookConsumerWidget { } return DraggableScrollableSheet( - controller: scrollController, initialChildSize: getInitialSize(), minChildSize: bottomPadding, maxChildSize: getMaxChildSize(), snap: true, - builder: ( - BuildContext context, - ScrollController scrollController, - ) { + controller: scrollController, + builder: (BuildContext context, ScrollController scrollController) { return Card( color: context.colorScheme.surfaceContainerHigh, surfaceTintColor: context.colorScheme.surfaceContainerHigh, diff --git a/mobile/lib/widgets/common/drag_sheet.dart b/mobile/lib/widgets/common/drag_sheet.dart index 923050bcc6..a98e000e51 100644 --- a/mobile/lib/widgets/common/drag_sheet.dart +++ b/mobile/lib/widgets/common/drag_sheet.dart @@ -33,6 +33,9 @@ class ControlBoxButton extends StatelessWidget { @override Widget build(BuildContext context) { + final minWidth = + context.isMobile ? MediaQuery.sizeOf(context).width / 4.5 : 75.0; + return MaterialButton( padding: const EdgeInsets.all(10), shape: const RoundedRectangleBorder( @@ -40,7 +43,7 @@ class ControlBoxButton extends StatelessWidget { ), onPressed: onPressed, onLongPress: onLongPressed, - minWidth: 75.0, + minWidth: minWidth, child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center,