mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
feat: add reset app scale hotkey (#5386)
Co-authored-by: Mathias Mogensen <mathiasrieckm@gmail.com>
This commit is contained in:
parent
0bfe071caf
commit
859eaf903b
@ -141,6 +141,16 @@ class _HomeHotKeysState extends State<HomeHotKeys> {
|
|||||||
keyDownHandler: (_) => _scaleWithStep(-0.1),
|
keyDownHandler: (_) => _scaleWithStep(-0.1),
|
||||||
),
|
),
|
||||||
|
|
||||||
|
// Reset app scaling
|
||||||
|
HotKeyItem(
|
||||||
|
hotKey: HotKey(
|
||||||
|
KeyCode.digit0,
|
||||||
|
modifiers: [Platform.isMacOS ? KeyModifier.meta : KeyModifier.control],
|
||||||
|
scope: HotKeyScope.inapp,
|
||||||
|
),
|
||||||
|
keyDownHandler: (_) => _scaleToSize(1),
|
||||||
|
),
|
||||||
|
|
||||||
// Open settings dialog
|
// Open settings dialog
|
||||||
openSettingsHotKey(context, widget.userProfile),
|
openSettingsHotKey(context, widget.userProfile),
|
||||||
];
|
];
|
||||||
@ -182,7 +192,11 @@ class _HomeHotKeysState extends State<HomeHotKeys> {
|
|||||||
|
|
||||||
Log.info('scale the app from $currentScaleFactor to $textScale');
|
Log.info('scale the app from $currentScaleFactor to $textScale');
|
||||||
|
|
||||||
ScaledWidgetsFlutterBinding.instance.scaleFactor = (_) => textScale;
|
await _scaleToSize(textScale);
|
||||||
await windowSizeManager.setScaleFactor(textScale);
|
}
|
||||||
|
|
||||||
|
Future<void> _scaleToSize(double size) async {
|
||||||
|
ScaledWidgetsFlutterBinding.instance.scaleFactor = (_) => size;
|
||||||
|
await windowSizeManager.setScaleFactor(size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user