mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-08 23:18:16 -07:00
chore: Shortcuts improvements (#446)
Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
parent
d0d6a2ffa6
commit
70e346b8a2
15 changed files with 481 additions and 198 deletions
|
|
@ -19,31 +19,26 @@ List<Widget> buildClientSettingsShortCuts(
|
|||
SettingsLabelDivider(label: context.localized.shortCuts),
|
||||
[
|
||||
...GlobalHotKeys.values.map(
|
||||
(entry) {
|
||||
final currentEntry = clientSettings.shortcuts[entry];
|
||||
final defaultEntry = clientSettings.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(clientSettingsProvider.notifier).setShortcuts(MapEntry(entry, value)),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
Flexible(
|
||||
child: KeyCombinationWidget(
|
||||
currentKey: clientSettings.shortcuts[entry],
|
||||
defaultKey: clientSettings.defaultShortCuts[entry]!,
|
||||
onChanged: (value) => ref.read(clientSettingsProvider.notifier).setShortcuts(MapEntry(entry, value)),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue