Skip to content

armgit / ente

Public Imported from GitHub
0

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

Let Photos menu icons inherit theme colors

AmanRajSinghMouryadb464c7204cd
diff --git a/mobile/apps/photos/changes/popup-menu-theme.md b/mobile/apps/photos/changes/popup-menu-theme.md
new file mode 100644
index 0000000000..c8b3dd1e07
--- /dev/null
+++ b/mobile/apps/photos/changes/popup-menu-theme.md
@@ -0,0 +1 @@
+- Fixed menu colors not updating when switching between light and dark themes.
diff --git a/mobile/apps/photos/lib/ui/viewer/gallery/gallery_app_bar_actions.dart b/mobile/apps/photos/lib/ui/viewer/gallery/gallery_app_bar_actions.dart
index b50574bbc7..105b5efb50 100644
--- a/mobile/apps/photos/lib/ui/viewer/gallery/gallery_app_bar_actions.dart
+++ b/mobile/apps/photos/lib/ui/viewer/gallery/gallery_app_bar_actions.dart
@@ -2,7 +2,6 @@ import "dart:async";
import "package:ente_components/ente_components.dart";
import "package:flutter/material.dart";
-import "package:hugeicons/hugeicons.dart";
class GalleryAppBarIconButtonSurface extends StatelessWidget {
const GalleryAppBarIconButtonSurface({required this.icon, super.key});
@@ -48,7 +47,3 @@ Widget galleryAppBarPopupMenuAction<T>({
),
);
}
-
-Widget galleryAppBarMenuIcon(List<List<dynamic>> icon, Color color) {
- return HugeIcon(icon: icon, size: IconSizes.small, color: color);
-}
diff --git a/mobile/apps/photos/lib/ui/viewer/gallery/gallery_app_bar_widget.dart b/mobile/apps/photos/lib/ui/viewer/gallery/gallery_app_bar_widget.dart
index 74b34eb6b7..2c0cd7daa1 100644
--- a/mobile/apps/photos/lib/ui/viewer/gallery/gallery_app_bar_widget.dart
+++ b/mobile/apps/photos/lib/ui/viewer/gallery/gallery_app_bar_widget.dart
@@ -504,16 +504,13 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
}
final strings = context.strings;
- final colorScheme = getEnteColorScheme(context);
if (!Configuration.instance.hasConfiguredAccount()) {
if (widget.showOverflowMenu && widget.deviceCollection != null) {
actions.add(
galleryAppBarPopupMenuAction<AlbumPopupAction>(
tooltip: strings.more,
icon: const HugeIcon(icon: HugeIcons.strokeRoundedMoreVertical),
- optionsBuilder: () => [
- _slideshowMenuOption(strings, colorScheme.contentLight),
- ],
+ optionsBuilder: () => [_slideshowMenuOption(strings)],
onSelected: (AlbumPopupAction value) async {
if (value == AlbumPopupAction.albumSlideshow) {
await _startAlbumSlideshow();
@@ -603,7 +600,6 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
icon: const HugeIcon(icon: HugeIcons.strokeRoundedMoreVertical),
optionsBuilder: () => _buildOverflowMenuOptions(
strings: strings,
- iconColor: colorScheme.contentLight,
userId: userId,
isArchived: isArchived,
isHidden: isHidden,
@@ -737,7 +733,6 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
Future<List<EntePopupMenuOption<AlbumPopupAction>>>
_buildOverflowMenuOptions({
required StringsLocalizations strings,
- required Color iconColor,
required int userId,
required bool isArchived,
required bool isHidden,
@@ -757,54 +752,78 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
_menuOption(
AlbumPopupAction.editDetails,
strings.editDetails,
- galleryAppBarMenuIcon(HugeIcons.strokeRoundedEdit03, iconColor),
+ const HugeIcon(
+ icon: HugeIcons.strokeRoundedEdit03,
+ size: IconSizes.small,
+ ),
),
if (galleryType == GalleryType.quickLink)
_menuOption(
AlbumPopupAction.convertToAlbum,
strings.convertToAlbum,
- galleryAppBarMenuIcon(HugeIcons.strokeRoundedAlbum02, iconColor),
+ const HugeIcon(
+ icon: HugeIcons.strokeRoundedAlbum02,
+ size: IconSizes.small,
+ ),
),
if (galleryType.showMap())
_menuOption(
AlbumPopupAction.map,
strings.map,
- galleryAppBarMenuIcon(HugeIcons.strokeRoundedLocation01, iconColor),
+ const HugeIcon(
+ icon: HugeIcons.strokeRoundedLocation01,
+ size: IconSizes.small,
+ ),
),
if (galleryType.canSort())
_menuOption(
AlbumPopupAction.sort,
strings.sortAlbumsBy,
- galleryAppBarMenuIcon(HugeIcons.strokeRoundedSorting01, iconColor),
+ const HugeIcon(
+ icon: HugeIcons.strokeRoundedSorting01,
+ size: IconSizes.small,
+ ),
),
if (galleryType == GalleryType.uncategorized)
_menuOption(
AlbumPopupAction.cleanUncategorized,
strings.cleanUncategorized,
- galleryAppBarMenuIcon(HugeIcons.strokeRoundedClean, iconColor),
+ const HugeIcon(
+ icon: HugeIcons.strokeRoundedClean,
+ size: IconSizes.small,
+ ),
),
if (galleryType.canPin())
_menuOption(
AlbumPopupAction.pinAlbum,
widget.collection!.isPinned ? strings.unpin : strings.pin,
- galleryAppBarMenuIcon(
- widget.collection!.isPinned
+ HugeIcon(
+ icon: widget.collection!.isPinned
? HugeIcons.strokeRoundedPinOff
: HugeIcons.strokeRoundedPin,
- iconColor,
+ size: IconSizes.small,
),
),
if (galleryType == GalleryType.locationTag)
_menuOption(
AlbumPopupAction.editLocation,
strings.editLocation,
- galleryAppBarMenuIcon(HugeIcons.strokeRoundedLocation01, iconColor),
+ const HugeIcon(
+ icon: HugeIcons.strokeRoundedLocation01,
+ size: IconSizes.small,
+ ),
),
if (galleryType == GalleryType.locationTag)
_menuOption(
AlbumPopupAction.deleteLocation,
strings.deleteLocation,
- galleryAppBarMenuIcon(HugeIcons.strokeRoundedDelete01, warningColor),
+ Builder(
+ builder: (context) => HugeIcon(
+ icon: HugeIcons.strokeRoundedDelete01,
+ size: IconSizes.small,
+ color: context.componentColors.warning,
+ ),
+ ),
labelColor: warningColor,
),
if (galleryType != GalleryType.sharedCollection &&
@@ -812,69 +831,76 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
_menuOption(
AlbumPopupAction.ownedArchive,
isArchived ? strings.unarchiveAlbum : strings.archiveAlbum,
- galleryAppBarMenuIcon(
- isArchived
+ HugeIcon(
+ icon: isArchived
? HugeIcons.strokeRoundedUnarchive03
: HugeIcons.strokeRoundedArchive03,
- iconColor,
+ size: IconSizes.small,
),
),
if (!isArchived && galleryType.canHide())
_menuOption(
AlbumPopupAction.ownedHide,
isHidden ? strings.unhide : strings.hide,
- galleryAppBarMenuIcon(
- isHidden
+ HugeIcon(
+ icon: isHidden
? HugeIcons.strokeRoundedView
: HugeIcons.strokeRoundedViewOffSlash,
- iconColor,
+ size: IconSizes.small,
),
),
if (widget.collection != null)
_menuOption(
AlbumPopupAction.galleryGuestView,
strings.guestView,
- galleryAppBarMenuIcon(HugeIcons.strokeRoundedIncognito, iconColor),
+ const HugeIcon(
+ icon: HugeIcons.strokeRoundedIncognito,
+ size: IconSizes.small,
+ ),
),
if (widget.collection != null && castService.isSupported)
_menuOption(
AlbumPopupAction.castAlbum,
strings.castAlbum,
- galleryAppBarMenuIcon(
- !flagService.enableMultiCast &&
+ HugeIcon(
+ icon:
+ !flagService.enableMultiCast &&
castService.getActiveSessions().isNotEmpty
? HugeIcons.strokeRoundedTvSmart
: HugeIcons.strokeRoundedTv02,
- iconColor,
+ size: IconSizes.small,
),
),
- if (_isAlbumSlideshowAvailable) _slideshowMenuOption(strings, iconColor),
+ if (_isAlbumSlideshowAvailable) _slideshowMenuOption(strings),
if (canAutoAdd)
_menuOption(
AlbumPopupAction.autoAddPhotos,
hasAutoAddPeople ? strings.editAutoAddPeople : strings.autoAddPeople,
- galleryAppBarMenuIcon(HugeIcons.strokeRoundedUserAdd01, iconColor),
+ const HugeIcon(
+ icon: HugeIcons.strokeRoundedUserAdd01,
+ size: IconSizes.small,
+ ),
),
if (galleryType.canDelete())
_menuOption(
isQuickLink ? AlbumPopupAction.removeLink : AlbumPopupAction.delete,
isQuickLink ? strings.removeLink : strings.deleteAlbum,
- galleryAppBarMenuIcon(
- isQuickLink
+ HugeIcon(
+ icon: isQuickLink
? HugeIcons.strokeRoundedLinkBackward
: HugeIcons.strokeRoundedDelete01,
- iconColor,
+ size: IconSizes.small,
),
),
if (galleryType == GalleryType.sharedCollection)
_menuOption(
AlbumPopupAction.shareePinAlbum,
widget.collection!.hasShareePinned() ? strings.unpin : strings.pin,
- galleryAppBarMenuIcon(
- widget.collection!.hasShareePinned()
+ HugeIcon(
+ icon: widget.collection!.hasShareePinned()
? HugeIcons.strokeRoundedPinOff
: HugeIcons.strokeRoundedPin,
- iconColor,
+ size: IconSizes.small,
),
),
if (galleryType == GalleryType.sharedCollection)
@@ -883,48 +909,60 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
widget.collection!.hasShareeArchived()
? strings.unarchiveAlbum
: strings.archiveAlbum,
- galleryAppBarMenuIcon(
- widget.collection!.hasShareeArchived()
+ HugeIcon(
+ icon: widget.collection!.hasShareeArchived()
? HugeIcons.strokeRoundedUnarchive03
: HugeIcons.strokeRoundedArchive03,
- iconColor,
+ size: IconSizes.small,
),
),
if (galleryType == GalleryType.sharedCollection)
_menuOption(
AlbumPopupAction.sharedHide,
widget.collection!.hasShareeHidden() ? strings.unhide : strings.hide,
- galleryAppBarMenuIcon(
- widget.collection!.hasShareeHidden()
+ HugeIcon(
+ icon: widget.collection!.hasShareeHidden()
? HugeIcons.strokeRoundedView
: HugeIcons.strokeRoundedViewOffSlash,
- iconColor,
+ size: IconSizes.small,
),
),
if (galleryType == GalleryType.sharedCollection)
_menuOption(
AlbumPopupAction.leave,
strings.leaveAlbum,
- galleryAppBarMenuIcon(HugeIcons.strokeRoundedLogout05, iconColor),
+ const HugeIcon(
+ icon: HugeIcons.strokeRoundedLogout05,
+ size: IconSizes.small,
+ ),
),
if (galleryType == GalleryType.localFolder && !_isICloudSharedAlbum)
_menuOption(
AlbumPopupAction.freeUpSpace,
strings.freeUpSpace,
- galleryAppBarMenuIcon(HugeIcons.strokeRoundedClean, iconColor),
+ const HugeIcon(
+ icon: HugeIcons.strokeRoundedClean,
+ size: IconSizes.small,
+ ),
),
if (_canDisableDeviceFolderBackup)
_menuOption(
AlbumPopupAction.disableBackup,
strings.disableBackup,
- galleryAppBarMenuIcon(HugeIcons.strokeRoundedUpload01, iconColor),
+ const HugeIcon(
+ icon: HugeIcons.strokeRoundedUpload01,
+ size: IconSizes.small,
+ ),
),
if (galleryType == GalleryType.sharedPublicCollection &&
(widget.collection?.isDownloadEnabledForPublicLink() ?? false))
_menuOption(
AlbumPopupAction.downloadAlbum,
strings.download,
- galleryAppBarMenuIcon(HugeIcons.strokeRoundedDownload01, iconColor),
+ const HugeIcon(
+ icon: HugeIcons.strokeRoundedDownload01,
+ size: IconSizes.small,
+ ),
),
];
}
@@ -944,12 +982,14 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
EntePopupMenuOption<AlbumPopupAction> _slideshowMenuOption(
StringsLocalizations strings,
- Color iconColor,
) {
return _menuOption(
AlbumPopupAction.albumSlideshow,
strings.slideshow,
- galleryAppBarMenuIcon(HugeIcons.strokeRoundedPresentation03, iconColor),
+ const HugeIcon(
+ icon: HugeIcons.strokeRoundedPresentation03,
+ size: IconSizes.small,
+ ),
);
}
diff --git a/mobile/apps/photos/lib/ui/viewer/people/cluster_app_bar.dart b/mobile/apps/photos/lib/ui/viewer/people/cluster_app_bar.dart
index 83a8ba0547..d3a3e5baf8 100644
--- a/mobile/apps/photos/lib/ui/viewer/people/cluster_app_bar.dart
+++ b/mobile/apps/photos/lib/ui/viewer/people/cluster_app_bar.dart
@@ -142,7 +142,6 @@ class _AppBarWidgetState extends State<ClusterAppBar> {
}
List<Widget> _getDefaultActions(BuildContext context) {
- final iconColor = getEnteColorScheme(context).contentLight;
final hasAccount = Configuration.instance.hasConfiguredAccount();
final List<Widget> actions = <Widget>[];
if (widget.selectedFiles.files.isNotEmpty) {
@@ -180,35 +179,35 @@ class _AppBarWidgetState extends State<ClusterAppBar> {
EntePopupMenuOption(
value: ClusterPopupAction.memoryLane,
label: context.strings.facesTimelineAppBarTitle,
- leadingWidget: galleryAppBarMenuIcon(
- HugeIcons.strokeRoundedSparkles,
- iconColor,
+ leadingWidget: const HugeIcon(
+ icon: HugeIcons.strokeRoundedSparkles,
+ size: IconSizes.small,
),
),
if (!isLocalGalleryMode && hasAccount) ...[
EntePopupMenuOption(
value: ClusterPopupAction.ignore,
label: context.strings.ignorePerson,
- leadingWidget: galleryAppBarMenuIcon(
- HugeIcons.strokeRoundedUserBlock01,
- iconColor,
+ leadingWidget: const HugeIcon(
+ icon: HugeIcons.strokeRoundedUserBlock01,
+ size: IconSizes.small,
),
),
EntePopupMenuOption(
value: ClusterPopupAction.breakupCluster,
label: context.strings.mixedGrouping,
- leadingWidget: galleryAppBarMenuIcon(
- HugeIcons.strokeRoundedUserMultiple,
- iconColor,
+ leadingWidget: const HugeIcon(
+ icon: HugeIcons.strokeRoundedUserMultiple,
+ size: IconSizes.small,
),
),
if (kDebugMode)
- EntePopupMenuOption(
+ const EntePopupMenuOption(
value: ClusterPopupAction.breakupClusterDebug,
label: "Debug mixed grouping",
- leadingWidget: galleryAppBarMenuIcon(
- HugeIcons.strokeRoundedAiBrain01,
- iconColor,
+ leadingWidget: HugeIcon(
+ icon: HugeIcons.strokeRoundedAiBrain01,
+ size: IconSizes.small,
),
),
],
diff --git a/mobile/apps/photos/lib/ui/viewer/people/people_app_bar.dart b/mobile/apps/photos/lib/ui/viewer/people/people_app_bar.dart
index 212ebf3d8b..c33d613112 100644
--- a/mobile/apps/photos/lib/ui/viewer/people/people_app_bar.dart
+++ b/mobile/apps/photos/lib/ui/viewer/people/people_app_bar.dart
@@ -271,7 +271,6 @@ class _AppBarWidgetState extends State<PeopleAppBar> {
}
List<Widget> _getDefaultActions(BuildContext context) {
- final iconColor = getEnteColorScheme(context).contentLight;
final bool isIgnored = person.data.isIgnored;
final bool isPinned = person.data.isPinned;
final bool hideFromMemories = person.data.hideFromMemories;
@@ -318,9 +317,9 @@ class _AppBarWidgetState extends State<PeopleAppBar> {
EntePopupMenuOption(
value: PeoplePopupAction.memoryLane,
label: context.strings.facesTimelineAppBarTitle,
- leadingWidget: galleryAppBarMenuIcon(
- HugeIcons.strokeRoundedSparkles,
- iconColor,
+ leadingWidget: const HugeIcon(
+ icon: HugeIcons.strokeRoundedSparkles,
+ size: IconSizes.small,
),
),
);
@@ -331,27 +330,27 @@ class _AppBarWidgetState extends State<PeopleAppBar> {
EntePopupMenuOption(
value: PeoplePopupAction.rename,
label: context.strings.edit,
- leadingWidget: galleryAppBarMenuIcon(
- HugeIcons.strokeRoundedPencilEdit01,
- iconColor,
+ leadingWidget: const HugeIcon(
+ icon: HugeIcons.strokeRoundedPencilEdit01,
+ size: IconSizes.small,
),
),
if (hasAssignedCluster)
EntePopupMenuOption(
value: PeoplePopupAction.reviewSuggestions,
label: context.strings.review,
- leadingWidget: galleryAppBarMenuIcon(
- HugeIcons.strokeRoundedSearch01,
- iconColor,
+ leadingWidget: const HugeIcon(
+ icon: HugeIcons.strokeRoundedSearch01,
+ size: IconSizes.small,
),
),
if (hasAssignedCluster)
EntePopupMenuOption(
value: PeoplePopupAction.setCover,
label: context.strings.setCover,
- leadingWidget: galleryAppBarMenuIcon(
- HugeIcons.strokeRoundedImage01,
- iconColor,
+ leadingWidget: const HugeIcon(
+ icon: HugeIcons.strokeRoundedImage01,
+ size: IconSizes.small,
),
),
EntePopupMenuOption(
@@ -359,11 +358,11 @@ class _AppBarWidgetState extends State<PeopleAppBar> {
label: isPinned
? context.strings.unpinPerson
: context.strings.pinPerson,
- leadingWidget: galleryAppBarMenuIcon(
- isPinned
+ leadingWidget: HugeIcon(
+ icon: isPinned
? HugeIcons.strokeRoundedPinOff
: HugeIcons.strokeRoundedPin,
- iconColor,
+ size: IconSizes.small,
),
),
EntePopupMenuOption(
@@ -371,11 +370,11 @@ class _AppBarWidgetState extends State<PeopleAppBar> {
label: hideFromMemories
? context.strings.showInMemories
: context.strings.hideFromMemories,
- leadingWidget: galleryAppBarMenuIcon(
- hideFromMemories
+ leadingWidget: HugeIcon(
+ icon: hideFromMemories
? HugeIcons.strokeRoundedView
: HugeIcons.strokeRoundedViewOffSlash,
- iconColor,
+ size: IconSizes.small,
),
),
if (isCurrentUserContactLink(
@@ -385,25 +384,25 @@ class _AppBarWidgetState extends State<PeopleAppBar> {
EntePopupMenuOption(
value: PeoplePopupAction.reassignMe,
label: context.strings.reassignMe,
- leadingWidget: galleryAppBarMenuIcon(
- HugeIcons.strokeRoundedUser,
- iconColor,
+ leadingWidget: const HugeIcon(
+ icon: HugeIcons.strokeRoundedUser,
+ size: IconSizes.small,
),
),
EntePopupMenuOption(
value: PeoplePopupAction.ignore,
label: context.strings.ignore,
- leadingWidget: galleryAppBarMenuIcon(
- HugeIcons.strokeRoundedUserBlock01,
- iconColor,
+ leadingWidget: const HugeIcon(
+ icon: HugeIcons.strokeRoundedUserBlock01,
+ size: IconSizes.small,
),
),
EntePopupMenuOption(
value: PeoplePopupAction.removeLabel,
label: context.strings.remove,
- leadingWidget: galleryAppBarMenuIcon(
- HugeIcons.strokeRoundedDelete01,
- iconColor,
+ leadingWidget: const HugeIcon(
+ icon: HugeIcons.strokeRoundedDelete01,
+ size: IconSizes.small,
),
),
]);
@@ -412,26 +411,26 @@ class _AppBarWidgetState extends State<PeopleAppBar> {
EntePopupMenuOption(
value: PeoplePopupAction.rename,
label: context.strings.edit,
- leadingWidget: galleryAppBarMenuIcon(
- HugeIcons.strokeRoundedPencilEdit01,
- iconColor,
+ leadingWidget: const HugeIcon(
+ icon: HugeIcons.strokeRoundedPencilEdit01,
+ size: IconSizes.small,
),
),
if (hasAssignedCluster)
EntePopupMenuOption(
value: PeoplePopupAction.reviewSuggestions,
label: context.strings.review,
- leadingWidget: galleryAppBarMenuIcon(
- HugeIcons.strokeRoundedSearch01,
- iconColor,
+ leadingWidget: const HugeIcon(
+ icon: HugeIcons.strokeRoundedSearch01,
+ size: IconSizes.small,
),
),
EntePopupMenuOption(
value: PeoplePopupAction.unignore,
label: context.strings.showPerson,
- leadingWidget: galleryAppBarMenuIcon(
- HugeIcons.strokeRoundedView,
- iconColor,
+ leadingWidget: const HugeIcon(
+ icon: HugeIcons.strokeRoundedView,
+ size: IconSizes.small,
),
),
]);