From b36b854950469e0875fd069358e7658a67c0585f Mon Sep 17 00:00:00 2001 From: fufesou Date: Fri, 4 Nov 2022 11:09:48 +0800 Subject: [PATCH] flutter_desktop: change tab menu Signed-off-by: fufesou --- .../lib/desktop/pages/remote_tab_page.dart | 57 ++++++++++--------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/flutter/lib/desktop/pages/remote_tab_page.dart b/flutter/lib/desktop/pages/remote_tab_page.dart index b486c5fca..9c9d56916 100644 --- a/flutter/lib/desktop/pages/remote_tab_page.dart +++ b/flutter/lib/desktop/pages/remote_tab_page.dart @@ -242,34 +242,6 @@ class _ConnectionTabPageState extends State { padding: padding, ), MenuEntryDivider(), - MenuEntryRadios( - text: translate('Scroll Style'), - optionsGetter: () => [ - MenuEntryRadioOption( - text: translate('ScrollAuto'), - value: 'scrollauto', - dismissOnClicked: true, - ), - MenuEntryRadioOption( - text: translate('Scrollbar'), - value: 'scrollbar', - dismissOnClicked: true, - ), - ], - curOptionGetter: () async { - return await bind.sessionGetOption(id: key, arg: 'scroll-style') ?? - ''; - }, - optionSetter: (String oldValue, String newValue) async { - await bind.sessionPeerOption( - id: key, name: "scroll-style", value: newValue); - ffi.canvasModel.updateScrollStyle(); - cancelFunc(); - }, - padding: padding, - dismissOnClicked: true, - ), - MenuEntryDivider(), () { final state = ShowRemoteCursorState.find(key); return MenuEntrySwitch2( @@ -290,6 +262,35 @@ class _ConnectionTabPageState extends State { ]); if (perms['keyboard'] != false) { + if (perms['clipboard'] != false) { + menu.add(MenuEntrySwitch( + switchType: SwitchType.scheckbox, + text: translate('Disable clipboard'), + getter: () async { + return bind.sessionGetToggleOptionSync( + id: key, arg: 'disable-clipboard'); + }, + setter: (bool v) async { + await bind.sessionToggleOption(id: key, value: 'disable-clipboard'); + cancelFunc(); + }, + padding: padding, + )); + } + + menu.add(MenuEntryButton( + childBuilder: (TextStyle? style) => Text( + translate('Insert Lock'), + style: style, + ), + proc: () { + bind.sessionLockScreen(id: key); + cancelFunc(); + }, + padding: padding, + dismissOnClicked: true, + )); + if (pi.platform == 'Linux' || pi.sasEnabled) { menu.add(MenuEntryButton( childBuilder: (TextStyle? style) => Text(