Skip to content

armgit / ente

Public Imported from GitHub
0

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

Minor fix

AmanRajSinghMouryaea22391c32e4
diff --git a/mobile/apps/locker/lib/ui/components/selection_action_widget.dart b/mobile/apps/locker/lib/ui/components/selection_action_widget.dart
deleted file mode 100644
index 594894d252..0000000000
--- a/mobile/apps/locker/lib/ui/components/selection_action_widget.dart
+++ /dev/null
@@ -1,59 +0,0 @@
-import "package:ente_ui/theme/ente_theme.dart";
-import "package:flutter/material.dart";
-
-class SelectionActionWidget extends StatelessWidget {
- final IconData icon;
- final String label;
- final VoidCallback onTap;
- final Color? iconColor;
- final Color? textColor;
-
- const SelectionActionWidget({
- required this.icon,
- required this.label,
- required this.onTap,
- this.iconColor,
- this.textColor,
- super.key,
- });
-
- @override
- Widget build(BuildContext context) {
- final colorScheme = getEnteColorScheme(context);
- final textTheme = getEnteTextTheme(context);
-
- final effectiveIconColor = iconColor ?? colorScheme.textBase;
- final effectiveTextColor = textColor ?? colorScheme.textBase;
-
- return Expanded(
- child: GestureDetector(
- onTap: onTap,
- child: Container(
- padding: const EdgeInsets.symmetric(
- vertical: 18.0,
- horizontal: 12.0,
- ),
- child: Column(
- mainAxisSize: MainAxisSize.min,
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- Icon(
- icon,
- color: effectiveIconColor,
- size: 24,
- ),
- const SizedBox(height: 8),
- Text(
- label,
- style: textTheme.body.copyWith(
- color: effectiveTextColor,
- ),
- textAlign: TextAlign.center,
- ),
- ],
- ),
- ),
- ),
- );
- }
-}
diff --git a/mobile/apps/locker/lib/ui/viewer/actions/file_selection_overlay_bar.dart b/mobile/apps/locker/lib/ui/viewer/actions/file_selection_overlay_bar.dart
index 0563f59d56..f5de5cd447 100644
--- a/mobile/apps/locker/lib/ui/viewer/actions/file_selection_overlay_bar.dart
+++ b/mobile/apps/locker/lib/ui/viewer/actions/file_selection_overlay_bar.dart
@@ -11,7 +11,6 @@ import "package:locker/services/files/sync/metadata_updater_service.dart";
import "package:locker/services/files/sync/models/file.dart";
import "package:locker/ui/components/file_edit_dialog.dart";
import "package:locker/ui/components/selection_action_button_widget.dart";
-import "package:locker/ui/components/selection_action_widget.dart";
import "package:locker/ui/components/share_link_dialog.dart";
import "package:locker/utils/snack_bar_utils.dart";
import "package:logging/logging.dart";
@@ -302,15 +301,20 @@ class _FileSelectionOverlayBarState extends State<FileSelectionOverlayBar> {
child: IntrinsicHeight(
child: Row(
children: [
- SelectionActionWidget(
- icon: Icons.edit_outlined,
- label: context.l10n.edit,
- onTap: () => _showEditDialog(context, file),
+ Expanded(
+ child: SelectionActionButton(
+ icon: Icons.edit_outlined,
+ label: context.l10n.edit,
+ onTap: () => _showEditDialog(context, file),
+ ),
),
- SelectionActionWidget(
- icon: _isImportant ? Icons.star : Icons.star_outline,
- label: _isImportant ? "Unmark" : "Important",
- onTap: () => _toggleImportant(context, file),
+ const SizedBox(width: 12),
+ Expanded(
+ child: SelectionActionButton(
+ icon: _isImportant ? Icons.star : Icons.star_outline,
+ label: _isImportant ? "Unmark" : "Important",
+ onTap: () => _toggleImportant(context, file),
+ ),
),
],
),
@@ -330,17 +334,21 @@ class _FileSelectionOverlayBarState extends State<FileSelectionOverlayBar> {
child: IntrinsicHeight(
child: Row(
children: [
- SelectionActionWidget(
- icon: Icons.star_outline,
- label: "Important",
- onTap: () => _markMultipleAsImportant(context, files),
+ Expanded(
+ child: SelectionActionButton(
+ icon: Icons.star_outline,
+ label: "Important",
+ onTap: () => _markMultipleAsImportant(context, files),
+ ),
),
- SelectionActionWidget(
- icon: Icons.delete_outline,
- label: context.l10n.delete,
- onTap: () => _deleteMultipleFile(context, files),
- iconColor: colorScheme.warning500,
- textColor: colorScheme.warning500,
+ const SizedBox(width: 12),
+ Expanded(
+ child: SelectionActionButton(
+ icon: Icons.delete_outline,
+ label: context.l10n.delete,
+ onTap: () => _deleteMultipleFile(context, files),
+ isDestructive: true,
+ ),
),
],
),