chore: Shortcuts improvements (#446)

Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
PartyDonut 2025-08-09 16:17:14 +02:00 committed by GitHub
parent d0d6a2ffa6
commit 70e346b8a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 481 additions and 198 deletions

View file

@ -207,31 +207,27 @@ class _PlayerSettingsPageState extends ConsumerState<PlayerSettingsPage> {
),
if (AdaptiveLayout.inputDeviceOf(context) == InputDevice.pointer)
...VideoHotKeys.values.map(
(entry) {
final currentEntry = videoSettings.hotKeys[entry];
final defaultEntry = videoSettings.defaultShortCuts[entry]!;
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: Row(
children: [
Expanded(
child: Text(
entry.label(context),
style: Theme.of(context).textTheme.titleLarge,
),
(entry) => Padding(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: Row(
children: [
Expanded(
child: Text(
entry.label(context),
style: Theme.of(context).textTheme.titleLarge,
),
Flexible(
child: KeyCombinationWidget(
currentKey: currentEntry,
defaultKey: defaultEntry,
onChanged: (value) =>
ref.read(videoPlayerSettingsProvider.notifier).setShortcuts(MapEntry(entry, value)),
),
)
],
),
);
},
),
Flexible(
child: KeyCombinationWidget(
currentKey: videoSettings.hotKeys[entry],
defaultKey: videoSettings.defaultShortCuts[entry]!,
onChanged: (value) =>
ref.read(videoPlayerSettingsProvider.notifier).setShortcuts(MapEntry(entry, value)),
),
)
],
),
),
)
],
),