#401 slideshow: added settings quick action

This commit is contained in:
Thibault Deckers 2023-02-05 19:45:03 +01:00
parent f62c31a46b
commit 8ced40a853
33 changed files with 101 additions and 52 deletions

View file

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

View file

@ -168,7 +168,7 @@
"@videoActionSelectStreams": {}, "@videoActionSelectStreams": {},
"videoActionSetSpeed": "Rychlost přehrávání", "videoActionSetSpeed": "Rychlost přehrávání",
"@videoActionSetSpeed": {}, "@videoActionSetSpeed": {},
"videoActionSettings": "Nastavení", "viewerActionSettings": "Nastavení",
"@videoActionSettings": {}, "@videoActionSettings": {},
"slideshowActionResume": "Pokračovat", "slideshowActionResume": "Pokračovat",
"@slideshowActionResume": {}, "@slideshowActionResume": {},

View file

@ -151,7 +151,7 @@
"@videoActionSelectStreams": {}, "@videoActionSelectStreams": {},
"videoActionSetSpeed": "Wiedergabegeschwindigkeit", "videoActionSetSpeed": "Wiedergabegeschwindigkeit",
"@videoActionSetSpeed": {}, "@videoActionSetSpeed": {},
"videoActionSettings": "Einstellungen", "viewerActionSettings": "Einstellungen",
"@videoActionSettings": {}, "@videoActionSettings": {},
"slideshowActionResume": "Wiedergabe", "slideshowActionResume": "Wiedergabe",
"@slideshowActionResume": {}, "@slideshowActionResume": {},

View file

@ -151,7 +151,7 @@
"@videoActionSelectStreams": {}, "@videoActionSelectStreams": {},
"videoActionSetSpeed": "Ταχύτητα αναπαραγωγής", "videoActionSetSpeed": "Ταχύτητα αναπαραγωγής",
"@videoActionSetSpeed": {}, "@videoActionSetSpeed": {},
"videoActionSettings": "Ρυθμίσεις", "viewerActionSettings": "Ρυθμίσεις",
"@videoActionSettings": {}, "@videoActionSettings": {},
"slideshowActionResume": "Συνέχιση", "slideshowActionResume": "Συνέχιση",
"@slideshowActionResume": {}, "@slideshowActionResume": {},

View file

@ -119,7 +119,8 @@
"videoActionSkip10": "Seek forward 10 seconds", "videoActionSkip10": "Seek forward 10 seconds",
"videoActionSelectStreams": "Select tracks", "videoActionSelectStreams": "Select tracks",
"videoActionSetSpeed": "Playback speed", "videoActionSetSpeed": "Playback speed",
"videoActionSettings": "Settings",
"viewerActionSettings": "Settings",
"slideshowActionResume": "Resume", "slideshowActionResume": "Resume",
"slideshowActionShowInCollection": "Show in Collection", "slideshowActionShowInCollection": "Show in Collection",

View file

@ -147,7 +147,7 @@
"@videoActionSelectStreams": {}, "@videoActionSelectStreams": {},
"videoActionSetSpeed": "Velocidad de reproducción", "videoActionSetSpeed": "Velocidad de reproducción",
"@videoActionSetSpeed": {}, "@videoActionSetSpeed": {},
"videoActionSettings": "Ajustes", "viewerActionSettings": "Ajustes",
"@videoActionSettings": {}, "@videoActionSettings": {},
"slideshowActionResume": "Reanudar", "slideshowActionResume": "Reanudar",
"@slideshowActionResume": {}, "@slideshowActionResume": {},

View file

@ -393,7 +393,7 @@
"@videoActionPlay": {}, "@videoActionPlay": {},
"videoActionReplay10": "10 segundu atzera egin", "videoActionReplay10": "10 segundu atzera egin",
"@videoActionReplay10": {}, "@videoActionReplay10": {},
"videoActionSettings": "Ezarpenak", "viewerActionSettings": "Ezarpenak",
"@videoActionSettings": {}, "@videoActionSettings": {},
"entryInfoActionEditDate": "Data eta ordua editatu", "entryInfoActionEditDate": "Data eta ordua editatu",
"@entryInfoActionEditDate": {}, "@entryInfoActionEditDate": {},

View file

@ -161,7 +161,7 @@
"@videoActionUnmute": {}, "@videoActionUnmute": {},
"videoActionSkip10": "جلو رفتن 10 ثانیه", "videoActionSkip10": "جلو رفتن 10 ثانیه",
"@videoActionSkip10": {}, "@videoActionSkip10": {},
"videoActionSettings": "تنظیمات", "viewerActionSettings": "تنظیمات",
"@videoActionSettings": {}, "@videoActionSettings": {},
"entryInfoActionEditRating": "ویرایش رتبه", "entryInfoActionEditRating": "ویرایش رتبه",
"@entryInfoActionEditRating": {}, "@entryInfoActionEditRating": {},

View file

@ -151,7 +151,7 @@
"@videoActionSelectStreams": {}, "@videoActionSelectStreams": {},
"videoActionSetSpeed": "Vitesse de lecture", "videoActionSetSpeed": "Vitesse de lecture",
"@videoActionSetSpeed": {}, "@videoActionSetSpeed": {},
"videoActionSettings": "Préférences", "viewerActionSettings": "Préférences",
"@videoActionSettings": {}, "@videoActionSettings": {},
"slideshowActionResume": "Reprendre", "slideshowActionResume": "Reprendre",
"@slideshowActionResume": {}, "@slideshowActionResume": {},

View file

@ -119,7 +119,7 @@
"@videoActionSelectStreams": {}, "@videoActionSelectStreams": {},
"videoActionSetSpeed": "Velocidade de reprodución", "videoActionSetSpeed": "Velocidade de reprodución",
"@videoActionSetSpeed": {}, "@videoActionSetSpeed": {},
"videoActionSettings": "Configuración", "viewerActionSettings": "Configuración",
"@videoActionSettings": {}, "@videoActionSettings": {},
"slideshowActionResume": "Resumo", "slideshowActionResume": "Resumo",
"@slideshowActionResume": {}, "@slideshowActionResume": {},

View file

@ -147,7 +147,7 @@
"@videoActionSelectStreams": {}, "@videoActionSelectStreams": {},
"videoActionSetSpeed": "Kecepatan pemutaran", "videoActionSetSpeed": "Kecepatan pemutaran",
"@videoActionSetSpeed": {}, "@videoActionSetSpeed": {},
"videoActionSettings": "Pengaturan", "viewerActionSettings": "Pengaturan",
"@videoActionSettings": {}, "@videoActionSettings": {},
"slideshowActionResume": "Lanjutkan", "slideshowActionResume": "Lanjutkan",
"@slideshowActionResume": {}, "@slideshowActionResume": {},

View file

@ -151,7 +151,7 @@
"@videoActionSelectStreams": {}, "@videoActionSelectStreams": {},
"videoActionSetSpeed": "Velocità di riproduzione", "videoActionSetSpeed": "Velocità di riproduzione",
"@videoActionSetSpeed": {}, "@videoActionSetSpeed": {},
"videoActionSettings": "Impostazioni", "viewerActionSettings": "Impostazioni",
"@videoActionSettings": {}, "@videoActionSettings": {},
"slideshowActionResume": "Riprendi", "slideshowActionResume": "Riprendi",
"@slideshowActionResume": {}, "@slideshowActionResume": {},

View file

@ -147,7 +147,7 @@
"@videoActionSelectStreams": {}, "@videoActionSelectStreams": {},
"videoActionSetSpeed": "再生速度", "videoActionSetSpeed": "再生速度",
"@videoActionSetSpeed": {}, "@videoActionSetSpeed": {},
"videoActionSettings": "設定", "viewerActionSettings": "設定",
"@videoActionSettings": {}, "@videoActionSettings": {},
"slideshowActionResume": "再開", "slideshowActionResume": "再開",
"@slideshowActionResume": {}, "@slideshowActionResume": {},

View file

@ -151,7 +151,7 @@
"@videoActionSelectStreams": {}, "@videoActionSelectStreams": {},
"videoActionSetSpeed": "재생 배속", "videoActionSetSpeed": "재생 배속",
"@videoActionSetSpeed": {}, "@videoActionSetSpeed": {},
"videoActionSettings": "설정", "viewerActionSettings": "설정",
"@videoActionSettings": {}, "@videoActionSettings": {},
"slideshowActionResume": "이어서", "slideshowActionResume": "이어서",
"@slideshowActionResume": {}, "@slideshowActionResume": {},

View file

@ -97,7 +97,7 @@
"@videoActionSkip10": {}, "@videoActionSkip10": {},
"videoActionSetSpeed": "Atkūrimo greitis", "videoActionSetSpeed": "Atkūrimo greitis",
"@videoActionSetSpeed": {}, "@videoActionSetSpeed": {},
"videoActionSettings": "Nustatymai", "viewerActionSettings": "Nustatymai",
"@videoActionSettings": {}, "@videoActionSettings": {},
"slideshowActionResume": "Tęsti", "slideshowActionResume": "Tęsti",
"@slideshowActionResume": {}, "@slideshowActionResume": {},

View file

@ -76,7 +76,7 @@
"@videoActionSkip10": {}, "@videoActionSkip10": {},
"videoActionSetSpeed": "Avspillingshastighet", "videoActionSetSpeed": "Avspillingshastighet",
"@videoActionSetSpeed": {}, "@videoActionSetSpeed": {},
"videoActionSettings": "Innstillinger", "viewerActionSettings": "Innstillinger",
"@videoActionSettings": {}, "@videoActionSettings": {},
"entryInfoActionEditTitleDescription": "Rediger navn og beskrivelse", "entryInfoActionEditTitleDescription": "Rediger navn og beskrivelse",
"@entryInfoActionEditTitleDescription": {}, "@entryInfoActionEditTitleDescription": {},

View file

@ -151,7 +151,7 @@
"@videoActionSelectStreams": {}, "@videoActionSelectStreams": {},
"videoActionSetSpeed": "Afspeelsnelheid", "videoActionSetSpeed": "Afspeelsnelheid",
"@videoActionSetSpeed": {}, "@videoActionSetSpeed": {},
"videoActionSettings": "Instellingen", "viewerActionSettings": "Instellingen",
"@videoActionSettings": {}, "@videoActionSettings": {},
"slideshowActionResume": "Hervatten", "slideshowActionResume": "Hervatten",
"@slideshowActionResume": {}, "@slideshowActionResume": {},

View file

@ -170,7 +170,7 @@
"@videoActionSelectStreams": {}, "@videoActionSelectStreams": {},
"videoActionSetSpeed": "Avspelingssnøggleik", "videoActionSetSpeed": "Avspelingssnøggleik",
"@videoActionSetSpeed": {}, "@videoActionSetSpeed": {},
"videoActionSettings": "Innstillingar", "viewerActionSettings": "Innstillingar",
"@videoActionSettings": {}, "@videoActionSettings": {},
"slideshowActionResume": "Hald fram", "slideshowActionResume": "Hald fram",
"@slideshowActionResume": {}, "@slideshowActionResume": {},

View file

@ -85,7 +85,7 @@
"@videoActionSelectStreams": {}, "@videoActionSelectStreams": {},
"videoActionSetSpeed": "Prędkość odtwarzania", "videoActionSetSpeed": "Prędkość odtwarzania",
"@videoActionSetSpeed": {}, "@videoActionSetSpeed": {},
"videoActionSettings": "Ustawienia", "viewerActionSettings": "Ustawienia",
"@videoActionSettings": {}, "@videoActionSettings": {},
"slideshowActionResume": "Wznów", "slideshowActionResume": "Wznów",
"@slideshowActionResume": {}, "@slideshowActionResume": {},

View file

@ -151,7 +151,7 @@
"@videoActionSelectStreams": {}, "@videoActionSelectStreams": {},
"videoActionSetSpeed": "Velocidade de reprodução", "videoActionSetSpeed": "Velocidade de reprodução",
"@videoActionSetSpeed": {}, "@videoActionSetSpeed": {},
"videoActionSettings": "Configurações", "viewerActionSettings": "Configurações",
"@videoActionSettings": {}, "@videoActionSettings": {},
"slideshowActionResume": "Retomar", "slideshowActionResume": "Retomar",
"@slideshowActionResume": {}, "@slideshowActionResume": {},

View file

@ -152,7 +152,7 @@
"@videoActionSkip10": {}, "@videoActionSkip10": {},
"videoActionSelectStreams": "Selectați piese", "videoActionSelectStreams": "Selectați piese",
"@videoActionSelectStreams": {}, "@videoActionSelectStreams": {},
"videoActionSettings": "Setări", "viewerActionSettings": "Setări",
"@videoActionSettings": {}, "@videoActionSettings": {},
"slideshowActionResume": "Reluare", "slideshowActionResume": "Reluare",
"@slideshowActionResume": {}, "@slideshowActionResume": {},

View file

@ -151,7 +151,7 @@
"@videoActionSelectStreams": {}, "@videoActionSelectStreams": {},
"videoActionSetSpeed": "Скорость вопспроизведения", "videoActionSetSpeed": "Скорость вопспроизведения",
"@videoActionSetSpeed": {}, "@videoActionSetSpeed": {},
"videoActionSettings": "Настройки", "viewerActionSettings": "Настройки",
"@videoActionSettings": {}, "@videoActionSettings": {},
"slideshowActionResume": "Продолжить", "slideshowActionResume": "Продолжить",
"@slideshowActionResume": {}, "@slideshowActionResume": {},

View file

@ -121,7 +121,7 @@
"@videoActionSkip10": {}, "@videoActionSkip10": {},
"slideshowActionShowInCollection": "แสดงคอลเลกชัน", "slideshowActionShowInCollection": "แสดงคอลเลกชัน",
"@slideshowActionShowInCollection": {}, "@slideshowActionShowInCollection": {},
"videoActionSettings": "ตั้งค่า", "viewerActionSettings": "ตั้งค่า",
"@videoActionSettings": {}, "@videoActionSettings": {},
"slideshowActionResume": "เล่นต่อ", "slideshowActionResume": "เล่นต่อ",
"@slideshowActionResume": {}, "@slideshowActionResume": {},

View file

@ -147,7 +147,7 @@
"@videoActionSelectStreams": {}, "@videoActionSelectStreams": {},
"videoActionSetSpeed": "Oynatma hızı", "videoActionSetSpeed": "Oynatma hızı",
"@videoActionSetSpeed": {}, "@videoActionSetSpeed": {},
"videoActionSettings": "Ayarlar", "viewerActionSettings": "Ayarlar",
"@videoActionSettings": {}, "@videoActionSettings": {},
"entryInfoActionEditDate": "Tarih ve saati düzenle", "entryInfoActionEditDate": "Tarih ve saati düzenle",
"@entryInfoActionEditDate": {}, "@entryInfoActionEditDate": {},

View file

@ -126,7 +126,7 @@
"@videoActionSkip10": {}, "@videoActionSkip10": {},
"videoActionSelectStreams": "Вибрати доріжку", "videoActionSelectStreams": "Вибрати доріжку",
"@videoActionSelectStreams": {}, "@videoActionSelectStreams": {},
"videoActionSettings": "Налаштування", "viewerActionSettings": "Налаштування",
"@videoActionSettings": {}, "@videoActionSettings": {},
"slideshowActionResume": "Продовжити", "slideshowActionResume": "Продовжити",
"@slideshowActionResume": {}, "@slideshowActionResume": {},

View file

@ -151,7 +151,7 @@
"@videoActionSelectStreams": {}, "@videoActionSelectStreams": {},
"videoActionSetSpeed": "播放速度", "videoActionSetSpeed": "播放速度",
"@videoActionSetSpeed": {}, "@videoActionSetSpeed": {},
"videoActionSettings": "设置", "viewerActionSettings": "设置",
"@videoActionSettings": {}, "@videoActionSettings": {},
"slideshowActionResume": "继续", "slideshowActionResume": "继续",
"@slideshowActionResume": {}, "@slideshowActionResume": {},

View file

@ -124,7 +124,7 @@
"@videoActionSelectStreams": {}, "@videoActionSelectStreams": {},
"videoActionSetSpeed": "播放速度", "videoActionSetSpeed": "播放速度",
"@videoActionSetSpeed": {}, "@videoActionSetSpeed": {},
"videoActionSettings": "設定", "viewerActionSettings": "設定",
"@videoActionSettings": {}, "@videoActionSettings": {},
"slideshowActionResume": "繼續", "slideshowActionResume": "繼續",
"@slideshowActionResume": {}, "@slideshowActionResume": {},

View file

@ -188,7 +188,7 @@ extension ExtraEntryAction on EntryAction {
case EntryAction.videoSetSpeed: case EntryAction.videoSetSpeed:
return context.l10n.videoActionSetSpeed; return context.l10n.videoActionSetSpeed;
case EntryAction.videoSettings: case EntryAction.videoSettings:
return context.l10n.videoActionSettings; return context.l10n.viewerActionSettings;
case EntryAction.videoTogglePlay: case EntryAction.videoTogglePlay:
// different data depending on toggle state // different data depending on toggle state
return context.l10n.videoActionPlay; return context.l10n.videoActionPlay;

View file

@ -5,6 +5,7 @@ import 'package:flutter/material.dart';
enum SlideshowAction { enum SlideshowAction {
resume, resume,
showInCollection, showInCollection,
settings,
} }
extension ExtraSlideshowAction on SlideshowAction { extension ExtraSlideshowAction on SlideshowAction {
@ -14,6 +15,8 @@ extension ExtraSlideshowAction on SlideshowAction {
return context.l10n.slideshowActionResume; return context.l10n.slideshowActionResume;
case SlideshowAction.showInCollection: case SlideshowAction.showInCollection:
return context.l10n.slideshowActionShowInCollection; return context.l10n.slideshowActionShowInCollection;
case SlideshowAction.settings:
return context.l10n.viewerActionSettings;
} }
} }
@ -25,6 +28,8 @@ extension ExtraSlideshowAction on SlideshowAction {
return AIcons.play; return AIcons.play;
case SlideshowAction.showInCollection: case SlideshowAction.showInCollection:
return AIcons.allCollection; return AIcons.allCollection;
case SlideshowAction.settings:
return AIcons.settings;
} }
} }
} }

View file

@ -260,6 +260,7 @@ class _EntryViewerStackState extends State<EntryViewerStack> with EntryViewContr
return []; return [];
case AppMode.slideshow: case AppMode.slideshow:
return [ return [
_buildViewerTopOverlay(availableSize),
_buildSlideshowBottomOverlay(availableSize), _buildSlideshowBottomOverlay(availableSize),
]; ];
default: default:

View file

@ -29,6 +29,7 @@ class _SlideshowButtonsState extends State<SlideshowButtons> {
static const List<SlideshowAction> _actions = [ static const List<SlideshowAction> _actions = [
SlideshowAction.resume, SlideshowAction.resume,
SlideshowAction.showInCollection, SlideshowAction.showInCollection,
SlideshowAction.settings,
]; ];
static const double _padding = ViewerButtonRowContent.padding; static const double _padding = ViewerButtonRowContent.padding;

View file

@ -1,21 +1,26 @@
import 'package:aves/app_mode.dart'; import 'package:aves/app_mode.dart';
import 'package:aves/model/actions/slideshow_actions.dart'; import 'package:aves/model/actions/slideshow_actions.dart';
import 'package:aves/model/entry.dart';
import 'package:aves/model/filters/album.dart'; import 'package:aves/model/filters/album.dart';
import 'package:aves/model/filters/mime.dart'; import 'package:aves/model/filters/mime.dart';
import 'package:aves/model/settings/enums/enums.dart'; import 'package:aves/model/settings/enums/enums.dart';
import 'package:aves/model/settings/settings.dart'; import 'package:aves/model/settings/settings.dart';
import 'package:aves/model/source/collection_lens.dart'; import 'package:aves/model/source/collection_lens.dart';
import 'package:aves/model/source/collection_source.dart';
import 'package:aves/theme/icons.dart'; import 'package:aves/theme/icons.dart';
import 'package:aves/widgets/collection/collection_page.dart'; import 'package:aves/widgets/collection/collection_page.dart';
import 'package:aves/widgets/common/basic/scaffold.dart'; import 'package:aves/widgets/common/basic/scaffold.dart';
import 'package:aves/widgets/common/extensions/build_context.dart'; import 'package:aves/widgets/common/extensions/build_context.dart';
import 'package:aves/widgets/common/identity/empty.dart'; import 'package:aves/widgets/common/identity/empty.dart';
import 'package:aves/widgets/settings/viewer/slideshow.dart';
import 'package:aves/widgets/viewer/controller.dart'; import 'package:aves/widgets/viewer/controller.dart';
import 'package:aves/widgets/viewer/entry_viewer_page.dart'; import 'package:aves/widgets/viewer/entry_viewer_page.dart';
import 'package:aves/widgets/viewer/entry_viewer_stack.dart'; import 'package:aves/widgets/viewer/entry_viewer_stack.dart';
import 'package:aves_magnifier/aves_magnifier.dart'; import 'package:aves_magnifier/aves_magnifier.dart';
import 'package:collection/collection.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:tuple/tuple.dart';
class SlideshowPage extends StatefulWidget { class SlideshowPage extends StatefulWidget {
static const routeName = '/collection/slideshow'; static const routeName = '/collection/slideshow';
@ -32,36 +37,33 @@ class SlideshowPage extends StatefulWidget {
} }
class _SlideshowPageState extends State<SlideshowPage> { class _SlideshowPageState extends State<SlideshowPage> {
late final ViewerController _viewerController; late ViewerController _viewerController;
late final CollectionLens _slideshowCollection; late CollectionLens _slideshowCollection;
AvesEntry? _initialEntry;
CollectionSource get source => widget.collection.source;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
_viewerController = ViewerController( _initViewerController(autopilot: true);
initialScale: ScaleLevel(ref: settings.slideshowFillScreen ? ScaleReference.covered : ScaleReference.contained),
transition: settings.slideshowTransition,
repeat: settings.slideshowRepeat,
autopilot: true,
autopilotInterval: Duration(seconds: settings.slideshowInterval),
autopilotAnimatedZoom: settings.slideshowAnimatedZoomEffect,
);
_initSlideshowCollection(); _initSlideshowCollection();
_initialEntry = _slideshowCollection.sortedEntries.firstOrNull;
} }
@override @override
void dispose() { void dispose() {
_viewerController.dispose(); _disposeViewerController();
super.dispose(); super.dispose();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final entries = _slideshowCollection.sortedEntries; final initialEntry = _initialEntry;
return ListenableProvider<ValueNotifier<AppMode>>.value( return ListenableProvider<ValueNotifier<AppMode>>.value(
value: ValueNotifier(AppMode.slideshow), value: ValueNotifier(AppMode.slideshow),
child: AvesScaffold( child: AvesScaffold(
body: entries.isEmpty body: initialEntry == null
? EmptyContent( ? EmptyContent(
icon: AIcons.image, icon: AIcons.image,
text: context.l10n.collectionEmptyImages, text: context.l10n.collectionEmptyImages,
@ -76,8 +78,9 @@ class _SlideshowPageState extends State<SlideshowPage> {
return true; return true;
}, },
child: EntryViewerStack( child: EntryViewerStack(
key: ValueKey(_viewerController),
collection: _slideshowCollection, collection: _slideshowCollection,
initialEntry: entries.first, initialEntry: initialEntry,
viewerController: _viewerController, viewerController: _viewerController,
), ),
), ),
@ -88,9 +91,21 @@ class _SlideshowPageState extends State<SlideshowPage> {
); );
} }
void _initViewerController({required bool autopilot}) {
_viewerController = ViewerController(
initialScale: ScaleLevel(ref: settings.slideshowFillScreen ? ScaleReference.covered : ScaleReference.contained),
transition: settings.slideshowTransition,
repeat: settings.slideshowRepeat,
autopilot: autopilot,
autopilotInterval: Duration(seconds: settings.slideshowInterval),
autopilotAnimatedZoom: settings.slideshowAnimatedZoomEffect,
);
}
void _disposeViewerController() => _viewerController.dispose();
void _initSlideshowCollection() { void _initSlideshowCollection() {
final originalCollection = widget.collection; var entries = List.of(widget.collection.sortedEntries);
var entries = originalCollection.sortedEntries;
if (settings.slideshowVideoPlayback == SlideshowVideoPlayback.skip) { if (settings.slideshowVideoPlayback == SlideshowVideoPlayback.skip) {
entries = entries.where((entry) => !MimeFilter.video.test(entry)).toList(); entries = entries.where((entry) => !MimeFilter.video.test(entry)).toList();
} }
@ -98,7 +113,7 @@ class _SlideshowPageState extends State<SlideshowPage> {
entries.shuffle(); entries.shuffle();
} }
_slideshowCollection = CollectionLens( _slideshowCollection = CollectionLens(
source: originalCollection.source, source: source,
listenToSource: false, listenToSource: false,
fixedSort: true, fixedSort: true,
fixedSelection: entries, fixedSelection: entries,
@ -113,16 +128,18 @@ class _SlideshowPageState extends State<SlideshowPage> {
case SlideshowAction.showInCollection: case SlideshowAction.showInCollection:
_showInCollection(); _showInCollection();
break; break;
case SlideshowAction.settings:
_showSettings(context);
break;
} }
} }
void _showInCollection() { void _showInCollection() {
final entry = _viewerController.entryNotifier.value; final currentEntry = _viewerController.entryNotifier.value;
if (entry == null) return; if (currentEntry == null) return;
final source = _slideshowCollection.source; final album = currentEntry.directory;
final album = entry.directory; final uri = currentEntry.uri;
final uri = entry.uri;
Navigator.maybeOf(context)?.pushAndRemoveUntil( Navigator.maybeOf(context)?.pushAndRemoveUntil(
MaterialPageRoute( MaterialPageRoute(
@ -136,6 +153,29 @@ class _SlideshowPageState extends State<SlideshowPage> {
(route) => false, (route) => false,
); );
} }
Tuple2<bool, bool> get collectionSettings => Tuple2(settings.slideshowShuffle, settings.slideshowVideoPlayback == SlideshowVideoPlayback.skip);
Future<void> _showSettings(BuildContext context) async {
final oldCollectionSettings = collectionSettings;
final currentEntry = _viewerController.entryNotifier.value;
await Navigator.maybeOf(context)?.push(
MaterialPageRoute(
settings: const RouteSettings(name: ViewerSlideshowPage.routeName),
builder: (context) => const ViewerSlideshowPage(),
),
);
_disposeViewerController();
_initViewerController(autopilot: false);
if (oldCollectionSettings != collectionSettings) {
_initSlideshowCollection();
}
final slideshowEntries = _slideshowCollection.sortedEntries;
_initialEntry = slideshowEntries.contains(currentEntry) ? currentEntry : slideshowEntries.firstOrNull;
setState(() {});
}
} }
class SlideshowActionNotification extends Notification { class SlideshowActionNotification extends Notification {

View file

@ -57,7 +57,7 @@
"videoActionSkip10", "videoActionSkip10",
"videoActionSelectStreams", "videoActionSelectStreams",
"videoActionSetSpeed", "videoActionSetSpeed",
"videoActionSettings", "viewerActionSettings",
"slideshowActionResume", "slideshowActionResume",
"slideshowActionShowInCollection", "slideshowActionShowInCollection",
"entryInfoActionEditDate", "entryInfoActionEditDate",
@ -1822,7 +1822,7 @@
"videoActionSkip10", "videoActionSkip10",
"videoActionSelectStreams", "videoActionSelectStreams",
"videoActionSetSpeed", "videoActionSetSpeed",
"videoActionSettings", "viewerActionSettings",
"slideshowActionResume", "slideshowActionResume",
"slideshowActionShowInCollection", "slideshowActionShowInCollection",
"entryInfoActionEditDate", "entryInfoActionEditDate",
@ -2755,7 +2755,7 @@
"videoActionSkip10", "videoActionSkip10",
"videoActionSelectStreams", "videoActionSelectStreams",
"videoActionSetSpeed", "videoActionSetSpeed",
"videoActionSettings", "viewerActionSettings",
"slideshowActionResume", "slideshowActionResume",
"slideshowActionShowInCollection", "slideshowActionShowInCollection",
"entryInfoActionEditDate", "entryInfoActionEditDate",