Compare commits

..
2 Commits
Author SHA1 Message Date
Siyi Guo 70f87c73fc optimize the use exciress 2023-04-13 19:18:32 +08:00
Siyi Guo ba642e21d0 add ExcludeFocus to avoid slider get the focus 2023-04-13 19:13:19 +08:00
2 changed files with 33 additions and 24 deletions

No files matched your search

+8 -5
View File
@@ -31,12 +31,12 @@ class _DraggableAreaState extends State<DraggableArea> {
bool isPressShift = false;
Axis? get axis {
if (isPressCommand) {
return Axis.vertical;
}
if (isPressShift) {
return Axis.horizontal;
}
if (isPressCommand) {
return Axis.vertical;
}
return null;
}
@@ -101,8 +101,11 @@ class _DraggableAreaState extends State<DraggableArea> {
setState(() {});
}
if (value is KeyUpEvent && isShift(value)) {
isPressShift = false;
setState(() {});
Future.delayed(const Duration(milliseconds: 500)).then((value) {
isPressShift = false;
if (!mounted) return;
setState(() {});
});
}
if (value is! KeyDownEvent && value is! KeyRepeatEvent) {
return KeyEventResult.ignored;
+25 -19
View File
@@ -59,13 +59,15 @@ class _ImagePageState extends State<ImagePage> with WindowListener {
child: 'Window Opacity'.toText(size: 12.dp),
),
Expanded(
child: Slider(
value: opacityWindow,
onChanged: (v) {
opacityWindow = v;
windowManager.setOpacity(opacityWindow);
setState(() {});
},
child: ExcludeFocus(
child: Slider(
value: opacityWindow,
onChanged: (v) {
opacityWindow = v;
windowManager.setOpacity(opacityWindow);
setState(() {});
},
),
),
),
],
@@ -175,12 +177,14 @@ class _ImagePageState extends State<ImagePage> with WindowListener {
),
SizedBox(
width: 80.dp,
child: Slider(
value: opacity1,
onChanged: (v) {
opacity1 = v;
setState(() {});
},
child: ExcludeFocus(
child: Slider(
value: opacity1,
onChanged: (v) {
opacity1 = v;
setState(() {});
},
),
),
),
const Spacer(),
@@ -201,12 +205,14 @@ class _ImagePageState extends State<ImagePage> with WindowListener {
),
SizedBox(
width: 80.dp,
child: Slider(
value: opacity2,
onChanged: (v) {
opacity2 = v;
setState(() {});
},
child: ExcludeFocus(
child: Slider(
value: opacity2,
onChanged: (v) {
opacity2 = v;
setState(() {});
},
),
),
)
],