feat: add key + as zoom-in key (#5628)

This commit is contained in:
Lucas.Xu 2024-06-26 13:27:13 +08:00 committed by GitHub
parent e4132ed217
commit 7d96c2dfd4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -136,13 +136,18 @@ class _HomeHotKeysState extends State<HomeHotKeys> {
),
// Scale up/down the app
HotKeyItem(
hotKey: HotKey(
KeyCode.equal,
modifiers: [Platform.isMacOS ? KeyModifier.meta : KeyModifier.control],
scope: HotKeyScope.inapp,
// In some keyboards, the system returns equal as + keycode, while others may return add as + keycode, so add them both as zoom in key.
...[KeyCode.equal, KeyCode.add].map(
(keycode) => HotKeyItem(
hotKey: HotKey(
keycode,
modifiers: [
Platform.isMacOS ? KeyModifier.meta : KeyModifier.control,
],
scope: HotKeyScope.inapp,
),
keyDownHandler: (_) => _scaleWithStep(0.1),
),
keyDownHandler: (_) => _scaleWithStep(0.1),
),
HotKeyItem(