fix: topbar 24px, ok tuslari Actions+DirectionalFocusIntent
Build Windows / build-windows (push) Has been cancelled
Build Windows / build-windows (push) Has been cancelled
This commit is contained in:
1 parent
5be314e857
commit
1658985f9c
6 files changed
+29
-41
No files matched your search
@@ -1,6 +1,5 @@
|
||||
import 'dart:async';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:window_manager/window_manager.dart';
|
||||
import 'package:desktop_drop/desktop_drop.dart';
|
||||
import '../services/image_manager.dart';
|
||||
@@ -25,26 +24,11 @@ class _ViewerScreenState extends State<ViewerScreen> with WindowListener {
|
||||
Timer? _pollTimer;
|
||||
Rect _lastBounds = Rect.zero;
|
||||
|
||||
bool _handleKeyEvent(KeyEvent event) {
|
||||
if (event is KeyDownEvent) {
|
||||
switch (event.logicalKey) {
|
||||
case LogicalKeyboardKey.arrowLeft:
|
||||
ImageManager.instance.previousImage();
|
||||
return true;
|
||||
case LogicalKeyboardKey.arrowRight:
|
||||
ImageManager.instance.nextImage();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
windowManager.addListener(this);
|
||||
ImageManager.instance.addListener(_onImageManagerChanged);
|
||||
HardwareKeyboard.instance.addHandler(_handleKeyEvent);
|
||||
|
||||
if (widget.initialFiles.isNotEmpty) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
@@ -78,7 +62,6 @@ class _ViewerScreenState extends State<ViewerScreen> with WindowListener {
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
HardwareKeyboard.instance.removeHandler(_handleKeyEvent);
|
||||
windowManager.removeListener(this);
|
||||
ImageManager.instance.removeListener(_onImageManagerChanged);
|
||||
_saveDebounce?.cancel();
|
||||
@@ -136,7 +119,7 @@ class _ViewerScreenState extends State<ViewerScreen> with WindowListener {
|
||||
child: Stack(
|
||||
children: [
|
||||
Positioned(
|
||||
top: 16,
|
||||
top: 24,
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
|
||||
Reference in new issue
Block a user