diff options
Diffstat (limited to 'lib/view/src/actions')
| -rw-r--r-- | lib/view/src/actions/chip.dart | 42 | ||||
| -rw-r--r-- | lib/view/src/actions/chip_set.dart | 81 | ||||
| -rw-r--r-- | lib/view/src/actions/entry.dart | 152 | ||||
| -rw-r--r-- | lib/view/src/actions/entry_set.dart | 97 | ||||
| -rw-r--r-- | lib/view/src/actions/explorer.dart | 27 | ||||
| -rw-r--r-- | lib/view/src/actions/map.dart | 29 | ||||
| -rw-r--r-- | lib/view/src/actions/map_cluster.dart | 23 | ||||
| -rw-r--r-- | lib/view/src/actions/share.dart | 23 | ||||
| -rw-r--r-- | lib/view/src/actions/slideshow.dart | 27 |
9 files changed, 501 insertions, 0 deletions
diff --git a/lib/view/src/actions/chip.dart b/lib/view/src/actions/chip.dart new file mode 100644 index 0000000..03afd44 --- /dev/null +++ b/lib/view/src/actions/chip.dart @@ -0,0 +1,42 @@ +import 'package:aves/theme/icons.dart'; +import 'package:aves/widgets/common/extensions/build_context.dart'; +import 'package:aves_model/aves_model.dart'; +import 'package:flutter/widgets.dart'; + +extension ExtraChipActionView on ChipAction { + String getText(BuildContext context) { + final l10n = context.l10n; + return switch (this) { + ChipAction.goToAlbumPage => l10n.chipActionGoToAlbumPage, + ChipAction.goToCountryPage => l10n.chipActionGoToCountryPage, + ChipAction.goToPlacePage => l10n.chipActionGoToPlacePage, + ChipAction.goToTagPage => l10n.chipActionGoToTagPage, + ChipAction.goToExplorerPage => l10n.chipActionGoToExplorerPage, + ChipAction.ratingOrGreater || + ChipAction.ratingOrLower => + // different data depending on state + toString(), + ChipAction.decompose => l10n.chipActionDecompose, + ChipAction.reverse => + // different data depending on state + l10n.chipActionFilterOut, + ChipAction.hide => l10n.chipActionHide, + ChipAction.lockVault => l10n.chipActionLock, + }; + } + + Widget getIcon() => Icon(_getIconData()); + + IconData _getIconData() => switch (this) { + ChipAction.goToAlbumPage => AIcons.album, + ChipAction.goToCountryPage => AIcons.country, + ChipAction.goToPlacePage => AIcons.place, + ChipAction.goToTagPage => AIcons.tag, + ChipAction.goToExplorerPage => AIcons.explorer, + ChipAction.ratingOrGreater || ChipAction.ratingOrLower => AIcons.rating, + ChipAction.decompose => AIcons.split, + ChipAction.reverse => AIcons.reverse, + ChipAction.hide => AIcons.hide, + ChipAction.lockVault => AIcons.vaultLock, + }; +} diff --git a/lib/view/src/actions/chip_set.dart b/lib/view/src/actions/chip_set.dart new file mode 100644 index 0000000..1c104b4 --- /dev/null +++ b/lib/view/src/actions/chip_set.dart @@ -0,0 +1,81 @@ +import 'package:aves/theme/icons.dart'; +import 'package:aves/widgets/common/extensions/build_context.dart'; +import 'package:aves_model/aves_model.dart'; +import 'package:flutter/material.dart'; + +extension ExtraChipSetActionView on ChipSetAction { + String getText(BuildContext context) { + final l10n = context.l10n; + return switch (this) { + // general + ChipSetAction.configureView => l10n.menuActionConfigureView, + ChipSetAction.select => l10n.menuActionSelect, + ChipSetAction.selectAll => l10n.menuActionSelectAll, + ChipSetAction.selectNone => l10n.menuActionSelectNone, + // browsing + ChipSetAction.search => MaterialLocalizations.of(context).searchFieldLabel, + ChipSetAction.toggleTitleSearch => + // different data depending on toggle state + l10n.collectionActionShowTitleSearch, + ChipSetAction.createGroup => l10n.chipActionCreateGroup, + ChipSetAction.createAlbum => l10n.chipActionCreateAlbum, + ChipSetAction.createVault => l10n.chipActionCreateVault, + // browsing or selecting + ChipSetAction.map => l10n.menuActionMap, + ChipSetAction.slideshow => l10n.menuActionSlideshow, + ChipSetAction.stats => l10n.menuActionStats, + // selecting (single/multiple filters) + ChipSetAction.delete => l10n.chipActionDelete, + ChipSetAction.remove => l10n.chipActionRemove, + ChipSetAction.hide => l10n.chipActionHide, + ChipSetAction.pin => l10n.chipActionPin, + ChipSetAction.unpin => l10n.chipActionUnpin, + ChipSetAction.group => l10n.chipActionGroup, + ChipSetAction.lockVault => l10n.chipActionLock, + ChipSetAction.showCountryStates => l10n.chipActionShowCountryStates, + ChipSetAction.showCollection => l10n.chipActionShowCollection, + // selecting (single filter) + ChipSetAction.rename => l10n.chipActionRename, + ChipSetAction.setCover => l10n.chipActionSetCover, + ChipSetAction.configureVault => l10n.chipActionConfigureVault, + }; + } + + Widget getIcon() => Icon(_getIconData()); + + IconData _getIconData() { + return switch (this) { + // general + ChipSetAction.configureView => AIcons.view, + ChipSetAction.select => AIcons.select, + ChipSetAction.selectAll => AIcons.selected, + ChipSetAction.selectNone => AIcons.unselected, + // browsing + ChipSetAction.search => AIcons.search, + ChipSetAction.toggleTitleSearch => + // different data depending on toggle state + AIcons.filter, + ChipSetAction.createGroup => AIcons.add, + ChipSetAction.createAlbum => AIcons.add, + ChipSetAction.createVault => AIcons.vaultAdd, + // browsing or selecting + ChipSetAction.map => AIcons.map, + ChipSetAction.slideshow => AIcons.slideshow, + ChipSetAction.stats => AIcons.stats, + // selecting (single/multiple filters) + ChipSetAction.delete => AIcons.delete, + ChipSetAction.remove => AIcons.remove, + ChipSetAction.hide => AIcons.hide, + ChipSetAction.pin => AIcons.pin, + ChipSetAction.unpin => AIcons.unpin, + ChipSetAction.group => AIcons.group, + ChipSetAction.lockVault => AIcons.vaultLock, + ChipSetAction.showCountryStates => AIcons.state, + ChipSetAction.showCollection => AIcons.allCollection, + // selecting (single filter) + ChipSetAction.rename => AIcons.rename, + ChipSetAction.setCover => AIcons.setCover, + ChipSetAction.configureVault => AIcons.vaultConfigure, + }; + } +} diff --git a/lib/view/src/actions/entry.dart b/lib/view/src/actions/entry.dart new file mode 100644 index 0000000..aa50b98 --- /dev/null +++ b/lib/view/src/actions/entry.dart @@ -0,0 +1,152 @@ +import 'package:aves/theme/colors.dart'; +import 'package:aves/theme/icons.dart'; +import 'package:aves/widgets/common/extensions/build_context.dart'; +import 'package:aves_model/aves_model.dart'; +import 'package:flutter/widgets.dart'; + +extension ExtraEntryActionView on EntryAction { + String getText(BuildContext context) { + final l10n = context.l10n; + return switch (this) { + EntryAction.info => l10n.entryActionInfo, + EntryAction.addShortcut => l10n.collectionActionAddShortcut, + EntryAction.copyToClipboard => l10n.entryActionCopyToClipboard, + EntryAction.delete => l10n.entryActionDelete, + EntryAction.restore => l10n.entryActionRestore, + EntryAction.convert => l10n.entryActionConvert, + EntryAction.print => l10n.entryActionPrint, + EntryAction.rename => l10n.entryActionRename, + EntryAction.copy => l10n.collectionActionCopy, + EntryAction.move => l10n.collectionActionMove, + EntryAction.share => l10n.entryActionShare, + EntryAction.toggleFavourite => + // different data depending on toggle state + l10n.entryActionAddFavourite, + // raster + EntryAction.rotateCCW => l10n.entryActionRotateCCW, + EntryAction.rotateCW => l10n.entryActionRotateCW, + EntryAction.flip => l10n.entryActionFlip, + // vector + EntryAction.viewSource => l10n.entryActionViewSource, + // video + EntryAction.lockViewer => l10n.viewerActionLock, + EntryAction.videoCaptureFrame => l10n.videoActionCaptureFrame, + EntryAction.videoToggleMute => + // different data depending on toggle state + l10n.videoActionMute, + EntryAction.videoSelectStreams => l10n.videoActionSelectStreams, + EntryAction.videoSetSpeed => l10n.videoActionSetSpeed, + EntryAction.videoABRepeat => l10n.videoActionABRepeat, + EntryAction.videoSettings => l10n.viewerActionSettings, + EntryAction.videoTogglePlay => + // different data depending on toggle state + l10n.videoActionPlay, + EntryAction.videoReplay10 => l10n.videoActionReplay10, + EntryAction.videoSkip10 => l10n.videoActionSkip10, + EntryAction.videoShowPreviousFrame => l10n.videoActionShowPreviousFrame, + EntryAction.videoShowNextFrame => l10n.videoActionShowNextFrame, + // external + EntryAction.edit => l10n.entryActionEdit, + EntryAction.open => l10n.entryActionOpen, + EntryAction.openVideoPlayer => l10n.videoControlsPlayOutside, + EntryAction.openMap => l10n.entryActionOpenMap, + EntryAction.setAs => l10n.entryActionSetAs, + EntryAction.cast => l10n.entryActionCast, + // platform + EntryAction.rotateScreen => l10n.entryActionRotateScreen, + // metadata + EntryAction.editDate => l10n.entryInfoActionEditDate, + EntryAction.editLocation => l10n.entryInfoActionEditLocation, + EntryAction.editTitleDescription => l10n.entryInfoActionEditTitleDescription, + EntryAction.editRating => l10n.entryInfoActionEditRating, + EntryAction.editTags => l10n.entryInfoActionEditTags, + EntryAction.removeMetadata => l10n.entryInfoActionRemoveMetadata, + EntryAction.exportMetadata => l10n.entryInfoActionExportMetadata, + // metadata / GeoTIFF + EntryAction.showGeoTiffOnMap => l10n.entryActionShowGeoTiffOnMap, + // metadata / motion photo + EntryAction.convertMotionPhotoToStillImage => l10n.entryActionConvertMotionPhotoToStillImage, + EntryAction.viewMotionPhotoVideo => l10n.entryActionViewMotionPhotoVideo, + // debug + EntryAction.debug => 'Debug', + }; + } + + Widget getIcon() { + final child = Icon(getIconData()); + return switch (this) { + EntryAction.debug => ShaderMask( + shaderCallback: AvesColorsData.debugGradient.createShader, + blendMode: BlendMode.srcIn, + child: child, + ), + _ => child, + }; + } + + IconData getIconData() { + return switch (this) { + EntryAction.info => AIcons.info, + EntryAction.addShortcut => AIcons.addShortcut, + EntryAction.copyToClipboard => AIcons.clipboard, + EntryAction.delete => AIcons.delete, + EntryAction.restore => AIcons.restore, + EntryAction.convert => AIcons.convert, + EntryAction.print => AIcons.print, + EntryAction.rename => AIcons.rename, + EntryAction.copy => AIcons.copy, + EntryAction.move => AIcons.move, + EntryAction.share => AIcons.share, + EntryAction.toggleFavourite => + // different data depending on toggle state + AIcons.favourite, + // raster + EntryAction.rotateCCW => AIcons.rotateLeft, + EntryAction.rotateCW => AIcons.rotateRight, + EntryAction.flip => AIcons.flip, + // vector + EntryAction.viewSource => AIcons.vector, + // video + EntryAction.lockViewer => AIcons.viewerLock, + EntryAction.videoCaptureFrame => AIcons.captureFrame, + EntryAction.videoToggleMute => + // different data depending on toggle state + AIcons.mute, + EntryAction.videoSelectStreams => AIcons.selectStreams, + EntryAction.videoSetSpeed => AIcons.setSpeed, + EntryAction.videoABRepeat => AIcons.repeat, + EntryAction.videoSettings => AIcons.videoSettings, + EntryAction.videoTogglePlay => + // different data depending on toggle state + AIcons.play, + EntryAction.videoReplay10 => AIcons.replay10, + EntryAction.videoSkip10 => AIcons.skip10, + EntryAction.videoShowPreviousFrame => AIcons.previousFrame, + EntryAction.videoShowNextFrame => AIcons.nextFrame, + // external + EntryAction.edit => AIcons.edit, + EntryAction.open => AIcons.openOutside, + EntryAction.openVideoPlayer => AIcons.openOutside, + EntryAction.openMap => AIcons.map, + EntryAction.setAs => AIcons.setAs, + EntryAction.cast => AIcons.cast, + // platform + EntryAction.rotateScreen => AIcons.rotateScreen, + // metadata + EntryAction.editDate => AIcons.date, + EntryAction.editLocation => AIcons.location, + EntryAction.editTitleDescription => AIcons.description, + EntryAction.editRating => AIcons.rating, + EntryAction.editTags => AIcons.tag, + EntryAction.removeMetadata => AIcons.clear, + EntryAction.exportMetadata => AIcons.fileExport, + // metadata / GeoTIFF + EntryAction.showGeoTiffOnMap => AIcons.map, + // metadata / motion photo + EntryAction.convertMotionPhotoToStillImage => AIcons.convertToStillImage, + EntryAction.viewMotionPhotoVideo => AIcons.openVideoPart, + // debug + EntryAction.debug => AIcons.debug, + }; + } +} diff --git a/lib/view/src/actions/entry_set.dart b/lib/view/src/actions/entry_set.dart new file mode 100644 index 0000000..393ff83 --- /dev/null +++ b/lib/view/src/actions/entry_set.dart @@ -0,0 +1,97 @@ +import 'package:aves/theme/icons.dart'; +import 'package:aves/widgets/common/extensions/build_context.dart'; +import 'package:aves_model/aves_model.dart'; +import 'package:flutter/material.dart'; + +extension ExtraEntrySetActionView on EntrySetAction { + String getText(BuildContext context) { + final l10n = context.l10n; + return switch (this) { + // general + EntrySetAction.configureView => l10n.menuActionConfigureView, + EntrySetAction.select => l10n.menuActionSelect, + EntrySetAction.selectAll => l10n.menuActionSelectAll, + EntrySetAction.selectNone => l10n.menuActionSelectNone, + // browsing + EntrySetAction.searchCollection => MaterialLocalizations.of(context).searchFieldLabel, + EntrySetAction.toggleTitleSearch => + // different data depending on toggle state + l10n.collectionActionShowTitleSearch, + EntrySetAction.addDynamicAlbum => l10n.collectionActionAddDynamicAlbum, + EntrySetAction.addShortcut => l10n.collectionActionAddShortcut, + EntrySetAction.setHome => l10n.collectionActionSetHome, + EntrySetAction.emptyBin => l10n.collectionActionEmptyBin, + // browsing or selecting + EntrySetAction.map => l10n.menuActionMap, + EntrySetAction.slideshow => l10n.menuActionSlideshow, + EntrySetAction.stats => l10n.menuActionStats, + EntrySetAction.rescan => l10n.collectionActionRescan, + // selecting + EntrySetAction.share => l10n.entryActionShare, + EntrySetAction.delete => l10n.entryActionDelete, + EntrySetAction.restore => l10n.entryActionRestore, + EntrySetAction.copy => l10n.collectionActionCopy, + EntrySetAction.move => l10n.collectionActionMove, + EntrySetAction.rename => l10n.entryActionRename, + EntrySetAction.convert => l10n.entryActionConvert, + EntrySetAction.toggleFavourite => + // different data depending on toggle state + l10n.entryActionAddFavourite, + EntrySetAction.rotateCCW => l10n.entryActionRotateCCW, + EntrySetAction.rotateCW => l10n.entryActionRotateCW, + EntrySetAction.flip => l10n.entryActionFlip, + EntrySetAction.editDate => l10n.entryInfoActionEditDate, + EntrySetAction.editLocation => l10n.entryInfoActionEditLocation, + EntrySetAction.editTitleDescription => l10n.entryInfoActionEditTitleDescription, + EntrySetAction.editRating => l10n.entryInfoActionEditRating, + EntrySetAction.editTags => l10n.entryInfoActionEditTags, + EntrySetAction.removeMetadata => l10n.entryInfoActionRemoveMetadata, + }; + } + + Widget getIcon() => Icon(_getIconData()); + + IconData _getIconData() { + return switch (this) { + // general + EntrySetAction.configureView => AIcons.view, + EntrySetAction.select => AIcons.select, + EntrySetAction.selectAll => AIcons.selected, + EntrySetAction.selectNone => AIcons.unselected, + // browsing + EntrySetAction.searchCollection => AIcons.search, + EntrySetAction.toggleTitleSearch => + // different data depending on toggle state + AIcons.filter, + EntrySetAction.addDynamicAlbum => AIcons.dynamicAlbum, + EntrySetAction.addShortcut => AIcons.addShortcut, + EntrySetAction.setHome => AIcons.home, + EntrySetAction.emptyBin => AIcons.emptyBin, + // browsing or selecting + EntrySetAction.map => AIcons.map, + EntrySetAction.slideshow => AIcons.slideshow, + EntrySetAction.stats => AIcons.stats, + EntrySetAction.rescan => AIcons.refresh, + // selecting + EntrySetAction.share => AIcons.share, + EntrySetAction.delete => AIcons.delete, + EntrySetAction.restore => AIcons.restore, + EntrySetAction.copy => AIcons.copy, + EntrySetAction.move => AIcons.move, + EntrySetAction.rename => AIcons.rename, + EntrySetAction.convert => AIcons.convert, + EntrySetAction.toggleFavourite => + // different data depending on toggle state + AIcons.favourite, + EntrySetAction.rotateCCW => AIcons.rotateLeft, + EntrySetAction.rotateCW => AIcons.rotateRight, + EntrySetAction.flip => AIcons.flip, + EntrySetAction.editDate => AIcons.date, + EntrySetAction.editLocation => AIcons.location, + EntrySetAction.editTitleDescription => AIcons.description, + EntrySetAction.editRating => AIcons.rating, + EntrySetAction.editTags => AIcons.tag, + EntrySetAction.removeMetadata => AIcons.clear, + }; + } +} diff --git a/lib/view/src/actions/explorer.dart b/lib/view/src/actions/explorer.dart new file mode 100644 index 0000000..b23c8fc --- /dev/null +++ b/lib/view/src/actions/explorer.dart @@ -0,0 +1,27 @@ +import 'package:aves/theme/icons.dart'; +import 'package:aves/widgets/common/extensions/build_context.dart'; +import 'package:aves_model/aves_model.dart'; +import 'package:flutter/material.dart'; + +extension ExtraExplorerActionView on ExplorerAction { + String getText(BuildContext context) { + final l10n = context.l10n; + return switch (this) { + ExplorerAction.addShortcut => l10n.collectionActionAddShortcut, + ExplorerAction.setHome => l10n.collectionActionSetHome, + ExplorerAction.hide => l10n.chipActionHide, + ExplorerAction.stats => l10n.menuActionStats, + }; + } + + Widget getIcon() => Icon(_getIconData()); + + IconData _getIconData() { + return switch (this) { + ExplorerAction.addShortcut => AIcons.addShortcut, + ExplorerAction.setHome => AIcons.home, + ExplorerAction.hide => AIcons.hide, + ExplorerAction.stats => AIcons.stats, + }; + } +} diff --git a/lib/view/src/actions/map.dart b/lib/view/src/actions/map.dart new file mode 100644 index 0000000..5e521a0 --- /dev/null +++ b/lib/view/src/actions/map.dart @@ -0,0 +1,29 @@ +import 'package:aves/theme/icons.dart'; +import 'package:aves/widgets/common/extensions/build_context.dart'; +import 'package:aves_model/aves_model.dart'; +import 'package:flutter/widgets.dart'; + +extension ExtraMapActionView on MapAction { + String getText(BuildContext context) { + final l10n = context.l10n; + return switch (this) { + MapAction.selectStyle => l10n.mapStyleTooltip, + MapAction.openMapApp => l10n.entryActionOpenMap, + MapAction.zoomIn => l10n.mapZoomInTooltip, + MapAction.zoomOut => l10n.mapZoomOutTooltip, + MapAction.addShortcut => l10n.collectionActionAddShortcut, + }; + } + + Widget getIcon() => Icon(_getIconData()); + + IconData _getIconData() { + return switch (this) { + MapAction.selectStyle => AIcons.layers, + MapAction.openMapApp => AIcons.openOutside, + MapAction.zoomIn => AIcons.zoomIn, + MapAction.zoomOut => AIcons.zoomOut, + MapAction.addShortcut => AIcons.addShortcut, + }; + } +} diff --git a/lib/view/src/actions/map_cluster.dart b/lib/view/src/actions/map_cluster.dart new file mode 100644 index 0000000..cf01679 --- /dev/null +++ b/lib/view/src/actions/map_cluster.dart @@ -0,0 +1,23 @@ +import 'package:aves/theme/icons.dart'; +import 'package:aves/widgets/common/extensions/build_context.dart'; +import 'package:aves_model/aves_model.dart'; +import 'package:flutter/widgets.dart'; + +extension ExtraMapClusterActionView on MapClusterAction { + String getText(BuildContext context) { + final l10n = context.l10n; + return switch (this) { + MapClusterAction.editLocation => l10n.entryInfoActionEditLocation, + MapClusterAction.removeLocation => l10n.entryInfoActionRemoveLocation, + }; + } + + Widget getIcon() => Icon(_getIconData()); + + IconData _getIconData() { + return switch (this) { + MapClusterAction.editLocation => AIcons.edit, + MapClusterAction.removeLocation => AIcons.clear, + }; + } +} diff --git a/lib/view/src/actions/share.dart b/lib/view/src/actions/share.dart new file mode 100644 index 0000000..fd1042e --- /dev/null +++ b/lib/view/src/actions/share.dart @@ -0,0 +1,23 @@ +import 'package:aves/theme/icons.dart'; +import 'package:aves/widgets/common/extensions/build_context.dart'; +import 'package:aves_model/aves_model.dart'; +import 'package:flutter/widgets.dart'; + +extension ExtraShareActionView on ShareAction { + String getText(BuildContext context) { + final l10n = context.l10n; + return switch (this) { + ShareAction.imageOnly => l10n.entryActionShareImageOnly, + ShareAction.videoOnly => l10n.entryActionShareVideoOnly, + }; + } + + Widget getIcon() => Icon(_getIconData()); + + IconData _getIconData() { + return switch (this) { + ShareAction.imageOnly => AIcons.image, + ShareAction.videoOnly => AIcons.video, + }; + } +} diff --git a/lib/view/src/actions/slideshow.dart b/lib/view/src/actions/slideshow.dart new file mode 100644 index 0000000..a047322 --- /dev/null +++ b/lib/view/src/actions/slideshow.dart @@ -0,0 +1,27 @@ +import 'package:aves/theme/icons.dart'; +import 'package:aves/widgets/common/extensions/build_context.dart'; +import 'package:aves_model/aves_model.dart'; +import 'package:flutter/widgets.dart'; + +extension ExtraSlideshowActionView on SlideshowAction { + String getText(BuildContext context) { + final l10n = context.l10n; + return switch (this) { + SlideshowAction.resume => l10n.slideshowActionResume, + SlideshowAction.showInCollection => l10n.slideshowActionShowInCollection, + SlideshowAction.cast => l10n.entryActionCast, + SlideshowAction.settings => l10n.viewerActionSettings, + }; + } + + Widget getIcon() => Icon(_getIconData()); + + IconData _getIconData() { + return switch (this) { + SlideshowAction.resume => AIcons.play, + SlideshowAction.showInCollection => AIcons.allCollection, + SlideshowAction.cast => AIcons.cast, + SlideshowAction.settings => AIcons.settings, + }; + } +} |
