#490 viewer: export actions available as quick actions

This commit is contained in:
Thibault Deckers 2023-02-05 17:02:44 +01:00
parent 52b60e15b9
commit f07244c144
4 changed files with 14 additions and 9 deletions

View file

@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file.
### Added
- Viewer: overlay details expand/collapse on tap
- Viewer: export actions available as quick actions
- TV: improved support for Info
### Changed

View file

@ -71,13 +71,15 @@ class EntryActions {
];
static const export = [
...exportInternal,
...exportExternal,
];
static const exportInternal = [
EntryAction.convert,
EntryAction.addShortcut,
EntryAction.copyToClipboard,
EntryAction.print,
EntryAction.open,
EntryAction.openMap,
EntryAction.setAs,
];
static const exportExternal = [

View file

@ -25,6 +25,7 @@ class ViewerActionEditorPage extends StatelessWidget {
EntryAction.flip,
],
[
...EntryActions.exportInternal,
EntryAction.videoCaptureFrame,
EntryAction.videoToggleMute,
EntryAction.videoSetSpeed,

View file

@ -71,15 +71,16 @@ class ViewerButtons extends StatelessWidget {
selector: (context, s) => s.isRotationLocked,
builder: (context, s, child) {
final quickActions = (trashed ? EntryActions.trashed : settings.viewerQuickActions).where(actionDelegate.isVisible).where(actionDelegate.canApply).take(availableCount - 1).toList();
final topLevelActions = EntryActions.topLevel.where((action) => !quickActions.contains(action)).where(actionDelegate.isVisible).toList();
final exportActions = EntryActions.export.where((action) => !quickActions.contains(action)).where(actionDelegate.isVisible).toList();
final videoActions = EntryActions.video.where((action) => !quickActions.contains(action)).where(actionDelegate.isVisible).toList();
List<EntryAction> getMenuActions(List<EntryAction> categoryActions) {
return categoryActions.where((action) => !quickActions.contains(action)).where(actionDelegate.isVisible).toList();
}
return ViewerButtonRowContent(
actionDelegate: EntryActionDelegate(mainEntry, pageEntry, collection),
quickActions: quickActions,
topLevelActions: topLevelActions,
exportActions: exportActions,
videoActions: videoActions,
topLevelActions: getMenuActions(EntryActions.topLevel),
exportActions: getMenuActions(EntryActions.export),
videoActions: getMenuActions(EntryActions.video),
scale: scale,
mainEntry: mainEntry,
pageEntry: pageEntry,