diff --git a/flutter_hbb/lib/model.dart b/flutter_hbb/lib/model.dart index 56e541748..374f366e8 100644 --- a/flutter_hbb/lib/model.dart +++ b/flutter_hbb/lib/model.dart @@ -44,6 +44,7 @@ class FfiModel with ChangeNotifier { if (k == 'name') return; _permissions[k] = v == 'true'; }); + print('$_permissions'); } void clear() { diff --git a/flutter_hbb/lib/remote_page.dart b/flutter_hbb/lib/remote_page.dart index c0a84b2b6..5d2d49df4 100644 --- a/flutter_hbb/lib/remote_page.dart +++ b/flutter_hbb/lib/remote_page.dart @@ -26,7 +26,6 @@ class _RemotePageState extends State { Timer _interval; bool _showBar = true; double _bottom = 0; - bool _pan = false; var _scaleMode = false; final FocusNode _focusNode = FocusNode(); @@ -143,15 +142,6 @@ class _RemotePageState extends State { showOptions(context); }, ), - Container( - color: _pan ? Colors.blue[500] : null, - child: IconButton( - color: Colors.white, - icon: Icon(Icons.pan_tool), - onPressed: () { - setState(() => _pan = !_pan); - }, - )) ]), IconButton( color: Colors.white, @@ -238,19 +228,22 @@ class _RemotePageState extends State { y = details.globalPosition.dy; } ..onLongPress = () { - print('long press'); () async { - await showMenu( + print('long press: $x $y'); + var value = await showMenu( context: context, - position: RelativeRect.fromLTRB(x, y, 0, 0), + position: + RelativeRect.fromLTRB(x + 20, y + 20, x + 20, y + 20), items: [ PopupMenuItem( - child: const Text('Doge'), value: 'Doge'), - PopupMenuItem( - child: const Text('Lion'), value: 'Lion'), + child: Text(_scaleMode ? 'Pan Mode' : 'Scale Mode'), + value: 'mode'), ], elevation: 8.0, ); + if (value == 'mode') { + setState(() => _scaleMode = !_scaleMode); + } }(); }; },