info: hide metadata edit actions when path is unknown
This commit is contained in:
parent
db863d68e3
commit
f422f848f4
1 changed files with 22 additions and 21 deletions
|
@ -43,28 +43,29 @@ class InfoAppBar extends StatelessWidget {
|
||||||
onPressed: () => _goToSearch(context),
|
onPressed: () => _goToSearch(context),
|
||||||
tooltip: MaterialLocalizations.of(context).searchFieldLabel,
|
tooltip: MaterialLocalizations.of(context).searchFieldLabel,
|
||||||
),
|
),
|
||||||
MenuIconTheme(
|
if (entry.canEdit)
|
||||||
child: PopupMenuButton<EntryInfoAction>(
|
MenuIconTheme(
|
||||||
itemBuilder: (context) {
|
child: PopupMenuButton<EntryInfoAction>(
|
||||||
return [
|
itemBuilder: (context) {
|
||||||
PopupMenuItem(
|
return [
|
||||||
value: EntryInfoAction.editDate,
|
PopupMenuItem(
|
||||||
enabled: entry.canEditExif,
|
value: EntryInfoAction.editDate,
|
||||||
child: MenuRow(text: context.l10n.entryInfoActionEditDate, icon: const Icon(AIcons.date)),
|
enabled: entry.canEditExif,
|
||||||
),
|
child: MenuRow(text: context.l10n.entryInfoActionEditDate, icon: const Icon(AIcons.date)),
|
||||||
PopupMenuItem(
|
),
|
||||||
value: EntryInfoAction.removeMetadata,
|
PopupMenuItem(
|
||||||
enabled: entry.canRemoveMetadata,
|
value: EntryInfoAction.removeMetadata,
|
||||||
child: MenuRow(text: context.l10n.entryInfoActionRemoveMetadata, icon: const Icon(AIcons.clear)),
|
enabled: entry.canRemoveMetadata,
|
||||||
),
|
child: MenuRow(text: context.l10n.entryInfoActionRemoveMetadata, icon: const Icon(AIcons.clear)),
|
||||||
];
|
),
|
||||||
},
|
];
|
||||||
onSelected: (action) {
|
},
|
||||||
// wait for the popup menu to hide before proceeding with the action
|
onSelected: (action) {
|
||||||
Future.delayed(Durations.popupMenuAnimation * timeDilation, () => EntryInfoActionDelegate(entry).onActionSelected(context, action));
|
// wait for the popup menu to hide before proceeding with the action
|
||||||
},
|
Future.delayed(Durations.popupMenuAnimation * timeDilation, () => EntryInfoActionDelegate(entry).onActionSelected(context, action));
|
||||||
|
},
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
],
|
],
|
||||||
titleSpacing: 0,
|
titleSpacing: 0,
|
||||||
floating: true,
|
floating: true,
|
||||||
|
|
Loading…
Reference in a new issue