Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mob][photos] Move edit option from bottom bar to app bar menu

ashilkn059dc95106ce
diff --git a/mobile/apps/photos/lib/ui/viewer/file/detail_page.dart b/mobile/apps/photos/lib/ui/viewer/file/detail_page.dart
index c84e291461..4b1723e87f 100644
--- a/mobile/apps/photos/lib/ui/viewer/file/detail_page.dart
+++ b/mobile/apps/photos/lib/ui/viewer/file/detail_page.dart
@@ -190,6 +190,7 @@ class _BodyState extends State<_Body> {
return FileAppBar(
_files![selectedIndex],
_onFileRemoved,
+ _onEditFileRequested,
widget.config.mode == DetailPageMode.full,
enableFullScreenNotifier: InheritedDetailPageState.of(context)
.enableFullScreenNotifier,
@@ -209,7 +210,6 @@ class _BodyState extends State<_Body> {
builder: (BuildContext context, int selectedIndex, _) {
return FileBottomBar(
_files![selectedIndex],
- _onEditFileRequested,
widget.config.mode == DetailPageMode.minimalistic &&
!isGuestView,
onFileRemoved: _onFileRemoved,
diff --git a/mobile/apps/photos/lib/ui/viewer/file/file_app_bar.dart b/mobile/apps/photos/lib/ui/viewer/file/file_app_bar.dart
index 6767ecf7d4..982eed1322 100644
--- a/mobile/apps/photos/lib/ui/viewer/file/file_app_bar.dart
+++ b/mobile/apps/photos/lib/ui/viewer/file/file_app_bar.dart
@@ -36,12 +36,14 @@ import "package:photos/utils/magic_util.dart";
class FileAppBar extends StatefulWidget {
final EnteFile file;
final Function(EnteFile) onFileRemoved;
+ final Function(EnteFile) onEditRequested;
final bool shouldShowActions;
final ValueNotifier<bool> enableFullScreenNotifier;
const FileAppBar(
this.file,
this.onFileRemoved,
+ this.onEditRequested,
this.shouldShowActions, {
required this.enableFullScreenNotifier,
super.key,
@@ -205,6 +207,19 @@ class FileAppBarState extends State<FileAppBar> {
),
);
}
+ // Edit option for images, live photos, and videos
+ if (widget.file.fileType == FileType.image ||
+ widget.file.fileType == FileType.livePhoto ||
+ widget.file.fileType == FileType.video) {
+ items.add(
+ EntePopupMenuItem(
+ AppLocalizations.of(context).edit,
+ value: 11,
+ icon: Icons.tune_outlined,
+ iconColor: Theme.of(context).iconTheme.color,
+ ),
+ );
+ }
// options for files owned by the user
if (isOwnedByUser && !isFileHidden && isFileUploaded) {
final bool isArchived =
@@ -374,6 +389,8 @@ class FileAppBarState extends State<FileAppBar> {
await _handleVideoStream('recreate');
} else if (value == 10) {
await _handleAddToAlbum();
+ } else if (value == 11) {
+ widget.onEditRequested(widget.file);
}
},
),
diff --git a/mobile/apps/photos/lib/ui/viewer/file/file_bottom_bar.dart b/mobile/apps/photos/lib/ui/viewer/file/file_bottom_bar.dart
index f85e1aaf91..41f1bd9e16 100644
--- a/mobile/apps/photos/lib/ui/viewer/file/file_bottom_bar.dart
+++ b/mobile/apps/photos/lib/ui/viewer/file/file_bottom_bar.dart
@@ -9,7 +9,6 @@ import "package:photos/events/guest_view_event.dart";
import "package:photos/generated/l10n.dart";
import "package:photos/models/file/extensions/file_props.dart";
import 'package:photos/models/file/file.dart';
-import 'package:photos/models/file/file_type.dart';
import 'package:photos/models/file/trash_file.dart';
import 'package:photos/models/selected_files.dart';
@@ -21,7 +20,6 @@ import 'package:photos/utils/share_util.dart';
class FileBottomBar extends StatefulWidget {
final EnteFile file;
- final Function(EnteFile) onEditRequested;
final Function(EnteFile) onFileRemoved;
final bool showOnlyInfoButton;
final int? userID;
@@ -30,7 +28,6 @@ class FileBottomBar extends StatefulWidget {
const FileBottomBar(
this.file,
- this.onEditRequested,
this.showOnlyInfoButton, {
required this.onFileRemoved,
required this.enableFullScreenNotifier,
@@ -112,27 +109,6 @@ class FileBottomBarState extends State<FileBottomBar> {
}
if (!widget.showOnlyInfoButton && widget.file is! TrashFile) {
- if (widget.file.fileType == FileType.image ||
- widget.file.fileType == FileType.livePhoto ||
- (widget.file.fileType == FileType.video)) {
- children.add(
- Tooltip(
- message: AppLocalizations.of(context).edit,
- child: Padding(
- padding: const EdgeInsets.only(top: 12),
- child: IconButton(
- icon: const Icon(
- Icons.tune_outlined,
- color: Colors.white,
- ),
- onPressed: () {
- widget.onEditRequested(widget.file);
- },
- ),
- ),
- ),
- );
- }
if (isOwnedByUser) {
children.add(
Tooltip(