fix: topbar 24px, ok tuslari Actions+DirectionalFocusIntent
Build Windows / build-windows (push) Has been cancelled

This commit is contained in:
Alhan committed 2026-07-22 05:28:15 +03:00
1 parent 5be314e857
commit 1658985f9c
6 files changed
+29 -41

No files matched your search

+24 -19
View File
@@ -11,25 +11,22 @@ class AppShortcuts extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Focus(
autofocus: true,
onKeyEvent: (node, event) {
if (event is KeyDownEvent) {
switch (event.logicalKey) {
case LogicalKeyboardKey.arrowLeft:
ImageManager.instance.previousImage();
return KeyEventResult.handled;
case LogicalKeyboardKey.arrowRight:
ImageManager.instance.nextImage();
return KeyEventResult.handled;
case LogicalKeyboardKey.escape:
windowManager.isFullScreen().then((isFullscreen) {
if (isFullscreen) windowManager.setFullScreen(false);
});
return KeyEventResult.handled;
}
}
return KeyEventResult.ignored;
return Actions(
actions: {
DirectionalFocusIntent: CallbackAction<DirectionalFocusIntent>(
onInvoke: (intent) {
switch (intent.direction) {
case TraversalDirection.left:
ImageManager.instance.previousImage();
return null;
case TraversalDirection.right:
ImageManager.instance.nextImage();
return null;
default:
return null;
}
},
),
},
child: CallbackShortcuts(
bindings: {
@@ -47,6 +44,14 @@ class AppShortcuts extends StatelessWidget {
await windowManager.setFullScreen(!isFullscreen);
},
// Escape
const SingleActivator(LogicalKeyboardKey.escape): () async {
final isFullscreen = await windowManager.isFullScreen();
if (isFullscreen) {
await windowManager.setFullScreen(false);
}
},
// Quit
const SingleActivator(
LogicalKeyboardKey.keyQ,