From ed3fd81ef7b23b5a3dcd1f715826b3bf644fd5de Mon Sep 17 00:00:00 2001 From: open-trade Date: Wed, 25 Nov 2020 01:13:08 +0800 Subject: [PATCH] start mouse tool --- flutter_hbb/lib/remote_page.dart | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/flutter_hbb/lib/remote_page.dart b/flutter_hbb/lib/remote_page.dart index 1369e4bbd..0d9b2814d 100644 --- a/flutter_hbb/lib/remote_page.dart +++ b/flutter_hbb/lib/remote_page.dart @@ -26,6 +26,7 @@ class _RemotePageState extends State { double _xOffset = 0; double _yOffset = 0; double _scale = 1; + bool _mouseTools = false; final FocusNode _focusNode = FocusNode(); @override @@ -125,15 +126,6 @@ class _RemotePageState extends State { SystemChannels.textInput .invokeMethod('TextInput.show'); }), - Transform.rotate( - angle: 15 * math.pi / 180, - child: IconButton( - color: Colors.white, - icon: Icon(Icons.flash_on), - onPressed: () { - showActions(context); - }, - )), IconButton( color: Colors.white, icon: Icon(Icons.tv), @@ -141,6 +133,22 @@ class _RemotePageState extends State { showOptions(context); }, ), + Container( + color: _mouseTools ? Colors.blue[500] : null, + child: IconButton( + color: Colors.white, + icon: Icon(Icons.mouse), + onPressed: () { + setState(() => _mouseTools = !_mouseTools); + }, + )), + IconButton( + color: Colors.white, + icon: Icon(Icons.more_vert), + onPressed: () { + showActions(context); + }, + ), ]), IconButton( color: Colors.white, @@ -176,6 +184,7 @@ class _RemotePageState extends State { _scale = scale; } }, + onScaleEnd: (_) {}, child: FlutterEasyLoading( child: Container( color: MyTheme.canvasColor, @@ -404,8 +413,8 @@ void showOptions(BuildContext context) { } void showActions(BuildContext context) { - final size = MediaQueryData.fromWindow(ui.window).size; - final x = 150.0; + final size = MediaQuery.of(context).size; + final x = 120.0; final y = size.height; () async { var value = await showMenu(