update gesture help widget
This commit is contained in:
parent
1a0162a581
commit
0de614bdb3
@ -1,4 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_hbb/widgets/gesture_help.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'dart:ui' as ui;
|
import 'dart:ui' as ui;
|
||||||
@ -282,14 +283,6 @@ class _RemotePageState extends State<RemotePage> {
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
] +
|
] +
|
||||||
(isDesktop
|
|
||||||
? []
|
|
||||||
: [
|
|
||||||
IconButton(
|
|
||||||
color: Colors.white,
|
|
||||||
icon: Icon(Icons.keyboard),
|
|
||||||
onPressed: openKeyboard)
|
|
||||||
]) +
|
|
||||||
<Widget>[
|
<Widget>[
|
||||||
IconButton(
|
IconButton(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
@ -303,6 +296,10 @@ class _RemotePageState extends State<RemotePage> {
|
|||||||
(isDesktop
|
(isDesktop
|
||||||
? []
|
? []
|
||||||
: [
|
: [
|
||||||
|
IconButton(
|
||||||
|
color: Colors.white,
|
||||||
|
icon: Icon(Icons.keyboard),
|
||||||
|
onPressed: openKeyboard),
|
||||||
Container(
|
Container(
|
||||||
color: _mouseTools ? Colors.blue[500] : null,
|
color: _mouseTools ? Colors.blue[500] : null,
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
@ -314,7 +311,19 @@ class _RemotePageState extends State<RemotePage> {
|
|||||||
resetTool();
|
resetTool();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
))
|
)),
|
||||||
|
IconButton(
|
||||||
|
color: Colors.white,
|
||||||
|
icon: Icon(Icons.help),
|
||||||
|
onPressed: () {
|
||||||
|
setState(() => _showEdit = false);
|
||||||
|
showModalBottomSheet(
|
||||||
|
backgroundColor: MyTheme.grayBg,
|
||||||
|
context: context,
|
||||||
|
builder: (context) =>
|
||||||
|
GestureHelp(initTouchMode: _touchMode));
|
||||||
|
},
|
||||||
|
)
|
||||||
]) +
|
]) +
|
||||||
<Widget>[
|
<Widget>[
|
||||||
IconButton(
|
IconButton(
|
||||||
@ -358,8 +367,8 @@ class _RemotePageState extends State<RemotePage> {
|
|||||||
FFI.tap(MouseButtons.left);
|
FFI.tap(MouseButtons.left);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onDoubleTapDown: (d){
|
onDoubleTapDown: (d) {
|
||||||
if(_touchMode){
|
if (_touchMode) {
|
||||||
FFI.cursorModel.move(d.localPosition.dx, d.localPosition.dy);
|
FFI.cursorModel.move(d.localPosition.dx, d.localPosition.dy);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -367,8 +376,8 @@ class _RemotePageState extends State<RemotePage> {
|
|||||||
FFI.tap(MouseButtons.left);
|
FFI.tap(MouseButtons.left);
|
||||||
FFI.tap(MouseButtons.left);
|
FFI.tap(MouseButtons.left);
|
||||||
},
|
},
|
||||||
onLongPressDown: (d){
|
onLongPressDown: (d) {
|
||||||
if (_touchMode){
|
if (_touchMode) {
|
||||||
FFI.cursorModel.move(d.localPosition.dx, d.localPosition.dy);
|
FFI.cursorModel.move(d.localPosition.dx, d.localPosition.dy);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_hbb/common.dart';
|
||||||
import 'package:toggle_switch/toggle_switch.dart';
|
import 'package:toggle_switch/toggle_switch.dart';
|
||||||
|
|
||||||
class GestureIcons {
|
class GestureIcons {
|
||||||
@ -32,15 +33,22 @@ class GestureIcons {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class GestureHelp extends StatefulWidget {
|
class GestureHelp extends StatefulWidget {
|
||||||
GestureHelp({Key? key}) : super(key: key);
|
GestureHelp({Key? key,this.initTouchMode = false}) : super(key: key);
|
||||||
|
final initTouchMode;
|
||||||
@override
|
@override
|
||||||
State<StatefulWidget> createState() => _GestureHelpState();
|
State<StatefulWidget> createState() => _GestureHelpState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _GestureHelpState extends State<GestureHelp> {
|
class _GestureHelpState extends State<GestureHelp> {
|
||||||
var _selectedIndex = 0;
|
var _selectedIndex;
|
||||||
var _touchMode = false;
|
var _touchMode;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
_touchMode = widget.initTouchMode;
|
||||||
|
_selectedIndex = _touchMode ? 1 : 0;
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@ -118,9 +126,9 @@ class GestureInfo extends StatelessWidget {
|
|||||||
final IconData icon;
|
final IconData icon;
|
||||||
|
|
||||||
final textSize = 15.0;
|
final textSize = 15.0;
|
||||||
final textColor = Colors.blue;
|
final textColor = MyTheme.accent80;
|
||||||
final iconSize = 35.0;
|
final iconSize = 35.0;
|
||||||
final iconColor = Colors.black54;
|
final iconColor = MyTheme.darkGray;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user