From 51a37f971aede50a94c69d7e2e0b095b1bbbd865 Mon Sep 17 00:00:00 2001 From: NicKoehler Date: Wed, 15 Mar 2023 17:57:52 +0100 Subject: [PATCH 1/5] changed monitor icon and implemented new setting to show monitors directly in menubar #3333 --- flutter/assets/screen.svg | 2 + .../desktop/pages/desktop_setting_page.dart | 1 + .../lib/desktop/widgets/remote_menubar.dart | 122 ++++++++++++++---- 3 files changed, 99 insertions(+), 26 deletions(-) create mode 100644 flutter/assets/screen.svg diff --git a/flutter/assets/screen.svg b/flutter/assets/screen.svg new file mode 100644 index 00000000..c1d560b2 --- /dev/null +++ b/flutter/assets/screen.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/flutter/lib/desktop/pages/desktop_setting_page.dart b/flutter/lib/desktop/pages/desktop_setting_page.dart index 4609d4f4..af7f7f96 100644 --- a/flutter/lib/desktop/pages/desktop_setting_page.dart +++ b/flutter/lib/desktop/pages/desktop_setting_page.dart @@ -1318,6 +1318,7 @@ class _DisplayState extends State<_Display> { Widget other(BuildContext context) { return _Card(title: 'Other Default Options', children: [ + otherRow('Show monitors in menu bar', 'show_monitors_menubar'), otherRow('Show remote cursor', 'show_remote_cursor'), otherRow('Zoom cursor', 'zoom-cursor'), otherRow('Show quality monitor', 'show_quality_monitor'), diff --git a/flutter/lib/desktop/widgets/remote_menubar.dart b/flutter/lib/desktop/widgets/remote_menubar.dart index d1189abe..6cfbf467 100644 --- a/flutter/lib/desktop/widgets/remote_menubar.dart +++ b/flutter/lib/desktop/widgets/remote_menubar.dart @@ -391,7 +391,16 @@ class _RemoteMenubarState extends State { _FullscreenMenu(state: widget.state, setFullscreen: _setFullscreen)); menubarItems.add(_MobileActionMenu(ffi: widget.ffi)); } - menubarItems.add(_MonitorMenu(id: widget.id, ffi: widget.ffi)); + + if (PrivacyModeState.find(widget.id).isTrue || + stateGlobal.displaysCount.value > 1) { + menubarItems.add( + bind.mainGetUserDefaultOption(key: 'show_monitors_menubar') == 'Y' + ? _MultiMonitorMenu(id: widget.id, ffi: widget.ffi) + : _MonitorMenu(id: widget.id, ffi: widget.ffi), + ); + } + menubarItems .add(_ControlMenu(id: widget.id, ffi: widget.ffi, state: widget.state)); menubarItems.add(_DisplayMenu( @@ -525,10 +534,6 @@ class _MonitorMenu extends StatelessWidget { @override Widget build(BuildContext context) { - if (PrivacyModeState.find(id).isTrue || - stateGlobal.displaysCount.value < 2) { - return Offstage(); - } return _IconSubmenuButton( tooltip: 'Select Monitor', icon: icon(), @@ -547,19 +552,20 @@ class _MonitorMenu extends StatelessWidget { alignment: Alignment.center, children: [ SvgPicture.asset( - "assets/display.svg", + "assets/screen.svg", color: Colors.white, ), - Padding( - padding: const EdgeInsets.only(bottom: 3.9), - child: Obx(() { - RxInt display = CurrentDisplayState.find(id); - return Text( - '${display.value + 1}/${pi.displays.length}', - style: const TextStyle(color: Colors.white, fontSize: 8), - ); - }), - ) + Obx(() { + RxInt display = CurrentDisplayState.find(id); + return Text( + '${display.value + 1}/${pi.displays.length}', + style: const TextStyle( + color: _MenubarTheme.blueColor, + fontSize: 8, + fontWeight: FontWeight.bold, + ), + ); + }), ], ); } @@ -582,19 +588,17 @@ class _MonitorMenu extends StatelessWidget { alignment: Alignment.center, children: [ SvgPicture.asset( - "assets/display.svg", + "assets/screen.svg", color: Colors.white, ), - Padding( - padding: const EdgeInsets.only(bottom: 3.5 /*2.5*/), - child: Text( - (i + 1).toString(), - style: TextStyle( - color: Colors.white, - fontSize: 12, - ), + Text( + (i + 1).toString(), + style: TextStyle( + color: _MenubarTheme.blueColor, + fontSize: 12, + fontWeight: FontWeight.bold, ), - ) + ), ], ), ), @@ -2204,3 +2208,69 @@ Widget _buildPointerTrackWidget(Widget child, FFI ffi) { ), ); } + +class _MultiMonitorMenu extends StatelessWidget { + final String id; + final FFI ffi; + + const _MultiMonitorMenu({ + super.key, + required this.id, + required this.ffi, + }); + + @override + Widget build(BuildContext context) { + final List rowChildren = []; + final pi = ffi.ffiModel.pi; + + for (int i = 0; i < pi.displays.length; i++) { + rowChildren.add( + Obx(() { + RxInt display = CurrentDisplayState.find(id); + return _IconMenuButton( + topLevel: false, + color: i == display.value + ? _MenubarTheme.blueColor + : Colors.grey[800]!, + hoverColor: i == display.value + ? _MenubarTheme.hoverBlueColor + : Colors.grey[850]!, + icon: Container( + alignment: AlignmentDirectional.center, + constraints: + const BoxConstraints(minHeight: _MenubarTheme.height), + child: Stack( + alignment: Alignment.center, + children: [ + SvgPicture.asset( + "assets/screen.svg", + color: Colors.white, + ), + Obx( + () => Text( + (i + 1).toString(), + style: TextStyle( + color: i == display.value + ? _MenubarTheme.blueColor + : Colors.grey[800]!, + fontSize: 12, + fontWeight: FontWeight.bold, + ), + ), + ), + ], + ), + ), + onPressed: () { + if (display.value != i) { + bind.sessionSwitchDisplay(id: id, value: i); + } + }, + ); + }), + ); + } + return Row(children: rowChildren); + } +} From 02fc7df4354cc74ff501218323cf241e0ac1d584 Mon Sep 17 00:00:00 2001 From: NicKoehler Date: Wed, 15 Mar 2023 18:03:28 +0100 Subject: [PATCH 2/5] added translations --- src/lang/ca.rs | 1 + src/lang/cn.rs | 1 + src/lang/cs.rs | 1 + src/lang/da.rs | 1 + src/lang/de.rs | 1 + src/lang/el.rs | 1 + src/lang/eo.rs | 1 + src/lang/es.rs | 1 + src/lang/fa.rs | 1 + src/lang/fr.rs | 1 + src/lang/hu.rs | 1 + src/lang/id.rs | 1 + src/lang/it.rs | 1 + src/lang/ja.rs | 1 + src/lang/ko.rs | 1 + src/lang/kz.rs | 1 + src/lang/nl.rs | 1 + src/lang/pl.rs | 1 + src/lang/pt_PT.rs | 1 + src/lang/ptbr.rs | 1 + src/lang/ro.rs | 1 + src/lang/ru.rs | 1 + src/lang/sk.rs | 1 + src/lang/sl.rs | 1 + src/lang/sq.rs | 1 + src/lang/sr.rs | 1 + src/lang/sv.rs | 1 + src/lang/template.rs | 1 + src/lang/th.rs | 1 + src/lang/tr.rs | 1 + src/lang/tw.rs | 1 + src/lang/ua.rs | 1 + src/lang/vn.rs | 1 + 33 files changed, 33 insertions(+) diff --git a/src/lang/ca.rs b/src/lang/ca.rs index 93d9c76f..b086cbb0 100644 --- a/src/lang/ca.rs +++ b/src/lang/ca.rs @@ -477,5 +477,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Username", ""), ("Empty Password", ""), ("Me", ""), + ("Show monitors in menu bar", ""), ].iter().cloned().collect(); } diff --git a/src/lang/cn.rs b/src/lang/cn.rs index bdc2257b..aee739f8 100644 --- a/src/lang/cn.rs +++ b/src/lang/cn.rs @@ -477,5 +477,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Username", ""), ("Empty Password", ""), ("Me", ""), + ("Show monitors in menu bar", ""), ].iter().cloned().collect(); } diff --git a/src/lang/cs.rs b/src/lang/cs.rs index 65104385..9ebe4cff 100644 --- a/src/lang/cs.rs +++ b/src/lang/cs.rs @@ -477,5 +477,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Username", ""), ("Empty Password", ""), ("Me", ""), + ("Show monitors in menu bar", ""), ].iter().cloned().collect(); } diff --git a/src/lang/da.rs b/src/lang/da.rs index 31ca52c1..478d7b92 100644 --- a/src/lang/da.rs +++ b/src/lang/da.rs @@ -477,5 +477,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Username", "Tom brugernavn"), ("Empty Password", "Tom adgangskode"), ("Me", "Mig"), + ("Show monitors in menu bar", ""), ].iter().cloned().collect(); } diff --git a/src/lang/de.rs b/src/lang/de.rs index 09fad80e..32f720f4 100644 --- a/src/lang/de.rs +++ b/src/lang/de.rs @@ -477,5 +477,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Username", "Leerer Benutzername"), ("Empty Password", "Leeres Passwort"), ("Me", "Ich"), + ("Show monitors in menu bar", ""), ].iter().cloned().collect(); } diff --git a/src/lang/el.rs b/src/lang/el.rs index 923d4b64..f62912cd 100644 --- a/src/lang/el.rs +++ b/src/lang/el.rs @@ -477,5 +477,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Username", "Κενό όνομα χρήστη"), ("Empty Password", "Κενός κωδικός πρόσβασης"), ("Me", ""), + ("Show monitors in menu bar", ""), ].iter().cloned().collect(); } diff --git a/src/lang/eo.rs b/src/lang/eo.rs index 57a51933..5403c888 100644 --- a/src/lang/eo.rs +++ b/src/lang/eo.rs @@ -477,5 +477,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Username", ""), ("Empty Password", ""), ("Me", ""), + ("Show monitors in menu bar", ""), ].iter().cloned().collect(); } diff --git a/src/lang/es.rs b/src/lang/es.rs index d1506128..d7c75309 100644 --- a/src/lang/es.rs +++ b/src/lang/es.rs @@ -477,5 +477,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Username", "Nombre de usuario vacío"), ("Empty Password", "Contraseña vacía"), ("Me", "Yo"), + ("Show monitors in menu bar", ""), ].iter().cloned().collect(); } diff --git a/src/lang/fa.rs b/src/lang/fa.rs index be982108..f3da03d2 100644 --- a/src/lang/fa.rs +++ b/src/lang/fa.rs @@ -477,5 +477,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Username", ""), ("Empty Password", ""), ("Me", ""), + ("Show monitors in menu bar", ""), ].iter().cloned().collect(); } diff --git a/src/lang/fr.rs b/src/lang/fr.rs index 5798253a..06bc82bf 100644 --- a/src/lang/fr.rs +++ b/src/lang/fr.rs @@ -477,5 +477,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Username", ""), ("Empty Password", ""), ("Me", ""), + ("Show monitors in menu bar", ""), ].iter().cloned().collect(); } diff --git a/src/lang/hu.rs b/src/lang/hu.rs index 672c65bb..73e3c41a 100644 --- a/src/lang/hu.rs +++ b/src/lang/hu.rs @@ -477,5 +477,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Username", ""), ("Empty Password", ""), ("Me", ""), + ("Show monitors in menu bar", ""), ].iter().cloned().collect(); } diff --git a/src/lang/id.rs b/src/lang/id.rs index a6272dbd..4c0fefd8 100644 --- a/src/lang/id.rs +++ b/src/lang/id.rs @@ -477,5 +477,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Username", ""), ("Empty Password", ""), ("Me", ""), + ("Show monitors in menu bar", ""), ].iter().cloned().collect(); } diff --git a/src/lang/it.rs b/src/lang/it.rs index 2333e23d..b0728ddf 100644 --- a/src/lang/it.rs +++ b/src/lang/it.rs @@ -477,5 +477,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Username", "Nome Utente Vuoto"), ("Empty Password", "Password Vuota"), ("Me", "Io"), + ("Show monitors in menu bar", "Mostra schermi nella barra di menù"), ].iter().cloned().collect(); } diff --git a/src/lang/ja.rs b/src/lang/ja.rs index 5b1bcec4..be6f337b 100644 --- a/src/lang/ja.rs +++ b/src/lang/ja.rs @@ -477,5 +477,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Username", ""), ("Empty Password", ""), ("Me", ""), + ("Show monitors in menu bar", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ko.rs b/src/lang/ko.rs index 3b31b631..c0e729ba 100644 --- a/src/lang/ko.rs +++ b/src/lang/ko.rs @@ -477,5 +477,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Username", ""), ("Empty Password", ""), ("Me", ""), + ("Show monitors in menu bar", ""), ].iter().cloned().collect(); } diff --git a/src/lang/kz.rs b/src/lang/kz.rs index ccce435f..18fee1e0 100644 --- a/src/lang/kz.rs +++ b/src/lang/kz.rs @@ -477,5 +477,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Username", ""), ("Empty Password", ""), ("Me", ""), + ("Show monitors in menu bar", ""), ].iter().cloned().collect(); } diff --git a/src/lang/nl.rs b/src/lang/nl.rs index 9574581e..033e7b8d 100644 --- a/src/lang/nl.rs +++ b/src/lang/nl.rs @@ -477,5 +477,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Username", "Gebruikersnaam Leeg"), ("Empty Password", "Wachtwoord Leeg"), ("Me", ""), + ("Show monitors in menu bar", ""), ].iter().cloned().collect(); } diff --git a/src/lang/pl.rs b/src/lang/pl.rs index 5534bbe1..8b256a4c 100644 --- a/src/lang/pl.rs +++ b/src/lang/pl.rs @@ -477,5 +477,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Username", ""), ("Empty Password", ""), ("Me", ""), + ("Show monitors in menu bar", ""), ].iter().cloned().collect(); } diff --git a/src/lang/pt_PT.rs b/src/lang/pt_PT.rs index 780bc46c..d583daa9 100644 --- a/src/lang/pt_PT.rs +++ b/src/lang/pt_PT.rs @@ -477,5 +477,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Username", ""), ("Empty Password", ""), ("Me", ""), + ("Show monitors in menu bar", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ptbr.rs b/src/lang/ptbr.rs index 5cfc2e5a..43ceb9a2 100644 --- a/src/lang/ptbr.rs +++ b/src/lang/ptbr.rs @@ -477,5 +477,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Username", ""), ("Empty Password", ""), ("Me", ""), + ("Show monitors in menu bar", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ro.rs b/src/lang/ro.rs index c354c468..a9b82e78 100644 --- a/src/lang/ro.rs +++ b/src/lang/ro.rs @@ -477,5 +477,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Username", ""), ("Empty Password", ""), ("Me", ""), + ("Show monitors in menu bar", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ru.rs b/src/lang/ru.rs index 3abea802..1f532863 100644 --- a/src/lang/ru.rs +++ b/src/lang/ru.rs @@ -477,5 +477,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Username", ""), ("Empty Password", ""), ("Me", ""), + ("Show monitors in menu bar", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sk.rs b/src/lang/sk.rs index 820b7a7d..c1ea4455 100644 --- a/src/lang/sk.rs +++ b/src/lang/sk.rs @@ -477,5 +477,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Username", ""), ("Empty Password", ""), ("Me", ""), + ("Show monitors in menu bar", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sl.rs b/src/lang/sl.rs index e81124d5..dd6050e5 100755 --- a/src/lang/sl.rs +++ b/src/lang/sl.rs @@ -477,5 +477,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Username", ""), ("Empty Password", ""), ("Me", ""), + ("Show monitors in menu bar", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sq.rs b/src/lang/sq.rs index d237b889..1eedfdfa 100644 --- a/src/lang/sq.rs +++ b/src/lang/sq.rs @@ -477,5 +477,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Username", ""), ("Empty Password", ""), ("Me", ""), + ("Show monitors in menu bar", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sr.rs b/src/lang/sr.rs index 8e7ecf82..d7c932cf 100644 --- a/src/lang/sr.rs +++ b/src/lang/sr.rs @@ -477,5 +477,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Username", ""), ("Empty Password", ""), ("Me", ""), + ("Show monitors in menu bar", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sv.rs b/src/lang/sv.rs index e0807d89..49be9ef1 100644 --- a/src/lang/sv.rs +++ b/src/lang/sv.rs @@ -477,5 +477,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Username", ""), ("Empty Password", ""), ("Me", ""), + ("Show monitors in menu bar", ""), ].iter().cloned().collect(); } diff --git a/src/lang/template.rs b/src/lang/template.rs index 085ed025..771ca4fc 100644 --- a/src/lang/template.rs +++ b/src/lang/template.rs @@ -477,5 +477,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Username", ""), ("Empty Password", ""), ("Me", ""), + ("Show monitors in menu bar", ""), ].iter().cloned().collect(); } diff --git a/src/lang/th.rs b/src/lang/th.rs index 6b3e34e4..c1c55927 100644 --- a/src/lang/th.rs +++ b/src/lang/th.rs @@ -477,5 +477,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Username", ""), ("Empty Password", ""), ("Me", ""), + ("Show monitors in menu bar", ""), ].iter().cloned().collect(); } diff --git a/src/lang/tr.rs b/src/lang/tr.rs index c92044e3..c31789ee 100644 --- a/src/lang/tr.rs +++ b/src/lang/tr.rs @@ -477,5 +477,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Username", ""), ("Empty Password", ""), ("Me", ""), + ("Show monitors in menu bar", ""), ].iter().cloned().collect(); } diff --git a/src/lang/tw.rs b/src/lang/tw.rs index a16bf26b..b123c73b 100644 --- a/src/lang/tw.rs +++ b/src/lang/tw.rs @@ -477,5 +477,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Username", ""), ("Empty Password", ""), ("Me", ""), + ("Show monitors in menu bar", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ua.rs b/src/lang/ua.rs index 302dd916..5779617b 100644 --- a/src/lang/ua.rs +++ b/src/lang/ua.rs @@ -477,5 +477,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Username", ""), ("Empty Password", ""), ("Me", ""), + ("Show monitors in menu bar", ""), ].iter().cloned().collect(); } diff --git a/src/lang/vn.rs b/src/lang/vn.rs index e72be8ea..55e29483 100644 --- a/src/lang/vn.rs +++ b/src/lang/vn.rs @@ -477,5 +477,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Username", ""), ("Empty Password", ""), ("Me", ""), + ("Show monitors in menu bar", ""), ].iter().cloned().collect(); } From 65d43a965f9147496d1aa3e4f94768eeb8e79654 Mon Sep 17 00:00:00 2001 From: NicKoehler Date: Wed, 15 Mar 2023 18:31:53 +0100 Subject: [PATCH 3/5] rename menubar into toolbar --- flutter/lib/desktop/pages/remote_page.dart | 2 +- .../lib/desktop/pages/remote_tab_page.dart | 2 +- ...emote_menubar.dart => remote_toolbar.dart} | 30 +++++++++---------- 3 files changed, 17 insertions(+), 17 deletions(-) rename flutter/lib/desktop/widgets/{remote_menubar.dart => remote_toolbar.dart} (99%) diff --git a/flutter/lib/desktop/pages/remote_page.dart b/flutter/lib/desktop/pages/remote_page.dart index 2099f2e9..2b1999b4 100644 --- a/flutter/lib/desktop/pages/remote_page.dart +++ b/flutter/lib/desktop/pages/remote_page.dart @@ -22,7 +22,7 @@ import '../../models/model.dart'; import '../../models/platform_model.dart'; import '../../common/shared_state.dart'; import '../../utils/image.dart'; -import '../widgets/remote_menubar.dart'; +import '../widgets/remote_toolbar.dart'; import '../widgets/kb_layout_type_chooser.dart'; bool _isCustomCursorInited = false; diff --git a/flutter/lib/desktop/pages/remote_tab_page.dart b/flutter/lib/desktop/pages/remote_tab_page.dart index d810650f..f9c30e8c 100644 --- a/flutter/lib/desktop/pages/remote_tab_page.dart +++ b/flutter/lib/desktop/pages/remote_tab_page.dart @@ -9,7 +9,7 @@ import 'package:flutter_hbb/common/shared_state.dart'; import 'package:flutter_hbb/consts.dart'; import 'package:flutter_hbb/models/state_model.dart'; import 'package:flutter_hbb/desktop/pages/remote_page.dart'; -import 'package:flutter_hbb/desktop/widgets/remote_menubar.dart'; +import 'package:flutter_hbb/desktop/widgets/remote_toolbar.dart'; import 'package:flutter_hbb/desktop/widgets/tabbar_widget.dart'; import 'package:flutter_hbb/desktop/widgets/material_mod_popup_menu.dart' as mod_menu; diff --git a/flutter/lib/desktop/widgets/remote_menubar.dart b/flutter/lib/desktop/widgets/remote_toolbar.dart similarity index 99% rename from flutter/lib/desktop/widgets/remote_menubar.dart rename to flutter/lib/desktop/widgets/remote_toolbar.dart index 8a1b2fbd..d836c4ab 100644 --- a/flutter/lib/desktop/widgets/remote_menubar.dart +++ b/flutter/lib/desktop/widgets/remote_toolbar.dart @@ -356,7 +356,7 @@ class _RemoteMenubarState extends State { return Align( alignment: Alignment.topCenter, child: Obx(() => show.value - ? _buildMenubar(context) + ? _buildToolbar(context) : _buildDraggableShowHide(context)), ); } @@ -384,39 +384,39 @@ class _RemoteMenubarState extends State { }); } - Widget _buildMenubar(BuildContext context) { - final List menubarItems = []; + Widget _buildToolbar(BuildContext context) { + final List toolbarItems = []; if (!isWebDesktop) { - menubarItems.add(_PinMenu(state: widget.state)); - menubarItems.add( + toolbarItems.add(_PinMenu(state: widget.state)); + toolbarItems.add( _FullscreenMenu(state: widget.state, setFullscreen: _setFullscreen)); - menubarItems.add(_MobileActionMenu(ffi: widget.ffi)); + toolbarItems.add(_MobileActionMenu(ffi: widget.ffi)); } if (PrivacyModeState.find(widget.id).isTrue || stateGlobal.displaysCount.value > 1) { - menubarItems.add( + toolbarItems.add( bind.mainGetUserDefaultOption(key: 'show_monitors_menubar') == 'Y' ? _MultiMonitorMenu(id: widget.id, ffi: widget.ffi) : _MonitorMenu(id: widget.id, ffi: widget.ffi), ); } - menubarItems + toolbarItems .add(_ControlMenu(id: widget.id, ffi: widget.ffi, state: widget.state)); - menubarItems.add(_DisplayMenu( + toolbarItems.add(_DisplayMenu( id: widget.id, ffi: widget.ffi, state: widget.state, setFullscreen: _setFullscreen, )); - menubarItems.add(_KeyboardMenu(id: widget.id, ffi: widget.ffi)); + toolbarItems.add(_KeyboardMenu(id: widget.id, ffi: widget.ffi)); if (!isWeb) { - menubarItems.add(_ChatMenu(id: widget.id, ffi: widget.ffi)); - menubarItems.add(_VoiceCallMenu(id: widget.id, ffi: widget.ffi)); + toolbarItems.add(_ChatMenu(id: widget.id, ffi: widget.ffi)); + toolbarItems.add(_VoiceCallMenu(id: widget.id, ffi: widget.ffi)); } - menubarItems.add(_RecordMenu()); - menubarItems.add(_CloseMenu(id: widget.id, ffi: widget.ffi)); + toolbarItems.add(_RecordMenu()); + toolbarItems.add(_CloseMenu(id: widget.id, ffi: widget.ffi)); return Column( mainAxisSize: MainAxisSize.min, children: [ @@ -436,7 +436,7 @@ class _RemoteMenubarState extends State { child: Row( children: [ SizedBox(width: _MenubarTheme.buttonHMargin * 2), - ...menubarItems, + ...toolbarItems, SizedBox(width: _MenubarTheme.buttonHMargin * 2) ], ), From c115a95fb13ada5fbb4ffa624b3a7a6876b9904f Mon Sep 17 00:00:00 2001 From: NicKoehler Date: Wed, 15 Mar 2023 18:35:30 +0100 Subject: [PATCH 4/5] added key show_monitors_tip --- src/lang/ca.rs | 2 +- src/lang/cn.rs | 2 +- src/lang/cs.rs | 2 +- src/lang/da.rs | 2 +- src/lang/de.rs | 2 +- src/lang/el.rs | 2 +- src/lang/en.rs | 1 + src/lang/eo.rs | 2 +- src/lang/es.rs | 2 +- src/lang/fa.rs | 2 +- src/lang/fr.rs | 2 +- src/lang/hu.rs | 2 +- src/lang/id.rs | 2 +- src/lang/it.rs | 2 +- src/lang/ja.rs | 2 +- src/lang/ko.rs | 2 +- src/lang/kz.rs | 2 +- src/lang/nl.rs | 2 +- src/lang/pl.rs | 2 +- src/lang/pt_PT.rs | 2 +- src/lang/ptbr.rs | 2 +- src/lang/ro.rs | 2 +- src/lang/ru.rs | 2 +- src/lang/sk.rs | 2 +- src/lang/sl.rs | 2 +- src/lang/sq.rs | 2 +- src/lang/sr.rs | 2 +- src/lang/sv.rs | 2 +- src/lang/template.rs | 2 +- src/lang/th.rs | 2 +- src/lang/tr.rs | 2 +- src/lang/tw.rs | 2 +- src/lang/ua.rs | 2 +- src/lang/vn.rs | 2 +- 34 files changed, 34 insertions(+), 33 deletions(-) diff --git a/src/lang/ca.rs b/src/lang/ca.rs index 585b784a..7a8e5e43 100644 --- a/src/lang/ca.rs +++ b/src/lang/ca.rs @@ -478,6 +478,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Password", ""), ("Me", ""), ("identical_file_tip", ""), - ("Show monitors in menu bar", ""), + ("show_monitors_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/cn.rs b/src/lang/cn.rs index ef2d6f50..0781a2a9 100644 --- a/src/lang/cn.rs +++ b/src/lang/cn.rs @@ -478,6 +478,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Password", ""), ("Me", ""), ("identical_file_tip", "此文件与对方的一致"), - ("Show monitors in menu bar", ""), + ("show_monitors_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/cs.rs b/src/lang/cs.rs index ac0e9e6b..03f8d624 100644 --- a/src/lang/cs.rs +++ b/src/lang/cs.rs @@ -478,6 +478,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Password", ""), ("Me", ""), ("identical_file_tip", ""), - ("Show monitors in menu bar", ""), + ("show_monitors_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/da.rs b/src/lang/da.rs index 14bcc515..cfb66528 100644 --- a/src/lang/da.rs +++ b/src/lang/da.rs @@ -478,6 +478,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Password", "Tom adgangskode"), ("Me", "Mig"), ("identical_file_tip", ""), - ("Show monitors in menu bar", ""), + ("show_monitors_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/de.rs b/src/lang/de.rs index 94e9832f..ab1e2976 100644 --- a/src/lang/de.rs +++ b/src/lang/de.rs @@ -478,6 +478,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Password", "Leeres Passwort"), ("Me", "Ich"), ("identical_file_tip", ""), - ("Show monitors in menu bar", ""), + ("show_monitors_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/el.rs b/src/lang/el.rs index 6ab774b3..e7defa94 100644 --- a/src/lang/el.rs +++ b/src/lang/el.rs @@ -478,6 +478,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Password", "Κενός κωδικός πρόσβασης"), ("Me", ""), ("identical_file_tip", ""), - ("Show monitors in menu bar", ""), + ("show_monitors_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/en.rs b/src/lang/en.rs index 38990924..eb09dacd 100644 --- a/src/lang/en.rs +++ b/src/lang/en.rs @@ -53,5 +53,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("empty_lan_tip", "Oh no, it looks like we haven't discovered any peers yet."), ("empty_address_book_tip", "Oh dear, it appears that there are currently no peers listed in your address book."), ("identical_file_tip", "This file is identical with the peer's one."), + ("show_monitors_tip", "Show monitors in toolbar") ].iter().cloned().collect(); } diff --git a/src/lang/eo.rs b/src/lang/eo.rs index 0a593041..2eb430d3 100644 --- a/src/lang/eo.rs +++ b/src/lang/eo.rs @@ -478,6 +478,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Password", ""), ("Me", ""), ("identical_file_tip", ""), - ("Show monitors in menu bar", ""), + ("show_monitors_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/es.rs b/src/lang/es.rs index b144d6a8..12a53721 100644 --- a/src/lang/es.rs +++ b/src/lang/es.rs @@ -478,6 +478,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Password", "Contraseña vacía"), ("Me", "Yo"), ("identical_file_tip", ""), - ("Show monitors in menu bar", ""), + ("show_monitors_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/fa.rs b/src/lang/fa.rs index 3a9f5874..c6aa36d5 100644 --- a/src/lang/fa.rs +++ b/src/lang/fa.rs @@ -478,6 +478,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Password", ""), ("Me", ""), ("identical_file_tip", ""), - ("Show monitors in menu bar", ""), + ("show_monitors_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/fr.rs b/src/lang/fr.rs index 3a28bbb9..b327972b 100644 --- a/src/lang/fr.rs +++ b/src/lang/fr.rs @@ -478,6 +478,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Password", ""), ("Me", ""), ("identical_file_tip", ""), - ("Show monitors in menu bar", ""), + ("show_monitors_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/hu.rs b/src/lang/hu.rs index 2aa1558e..b4df936b 100644 --- a/src/lang/hu.rs +++ b/src/lang/hu.rs @@ -478,6 +478,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Password", ""), ("Me", ""), ("identical_file_tip", ""), - ("Show monitors in menu bar", ""), + ("show_monitors_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/id.rs b/src/lang/id.rs index 1927d582..465f2082 100644 --- a/src/lang/id.rs +++ b/src/lang/id.rs @@ -478,6 +478,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Password", ""), ("Me", ""), ("identical_file_tip", ""), - ("Show monitors in menu bar", ""), + ("show_monitors_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/it.rs b/src/lang/it.rs index 4ca57782..94fea4e0 100644 --- a/src/lang/it.rs +++ b/src/lang/it.rs @@ -478,6 +478,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Password", "Password Vuota"), ("Me", "Io"), ("identical_file_tip", "Questo file è identico a quello del peer."), - ("Show monitors in menu bar", "Mostra schermi nella barra di menù"), + ("show_monitors_tip", "Mostra schermi nella barra degli strumenti"), ].iter().cloned().collect(); } diff --git a/src/lang/ja.rs b/src/lang/ja.rs index 31fa936c..d5bd2e97 100644 --- a/src/lang/ja.rs +++ b/src/lang/ja.rs @@ -478,6 +478,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Password", ""), ("Me", ""), ("identical_file_tip", ""), - ("Show monitors in menu bar", ""), + ("show_monitors_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ko.rs b/src/lang/ko.rs index a857dd56..83ba0191 100644 --- a/src/lang/ko.rs +++ b/src/lang/ko.rs @@ -478,6 +478,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Password", ""), ("Me", ""), ("identical_file_tip", ""), - ("Show monitors in menu bar", ""), + ("show_monitors_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/kz.rs b/src/lang/kz.rs index 4bcd4949..de33f7e5 100644 --- a/src/lang/kz.rs +++ b/src/lang/kz.rs @@ -478,6 +478,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Password", ""), ("Me", ""), ("identical_file_tip", ""), - ("Show monitors in menu bar", ""), + ("show_monitors_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/nl.rs b/src/lang/nl.rs index 0dc7e6bb..05fc9a65 100644 --- a/src/lang/nl.rs +++ b/src/lang/nl.rs @@ -478,6 +478,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Password", "Wachtwoord Leeg"), ("Me", ""), ("identical_file_tip", ""), - ("Show monitors in menu bar", ""), + ("show_monitors_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/pl.rs b/src/lang/pl.rs index 8a8f51ab..e93635ca 100644 --- a/src/lang/pl.rs +++ b/src/lang/pl.rs @@ -478,6 +478,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Password", ""), ("Me", ""), ("identical_file_tip", ""), - ("Show monitors in menu bar", ""), + ("show_monitors_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/pt_PT.rs b/src/lang/pt_PT.rs index 603dd0d5..a2189a7b 100644 --- a/src/lang/pt_PT.rs +++ b/src/lang/pt_PT.rs @@ -478,6 +478,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Password", ""), ("Me", ""), ("identical_file_tip", ""), - ("Show monitors in menu bar", ""), + ("show_monitors_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ptbr.rs b/src/lang/ptbr.rs index 7eaaabd7..19db9e98 100644 --- a/src/lang/ptbr.rs +++ b/src/lang/ptbr.rs @@ -478,6 +478,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Password", ""), ("Me", ""), ("identical_file_tip", ""), - ("Show monitors in menu bar", ""), + ("show_monitors_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ro.rs b/src/lang/ro.rs index 0b26f382..382844fb 100644 --- a/src/lang/ro.rs +++ b/src/lang/ro.rs @@ -478,6 +478,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Password", ""), ("Me", ""), ("identical_file_tip", ""), - ("Show monitors in menu bar", ""), + ("show_monitors_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ru.rs b/src/lang/ru.rs index 7c17c2b4..ee35e598 100644 --- a/src/lang/ru.rs +++ b/src/lang/ru.rs @@ -478,6 +478,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Password", ""), ("Me", ""), ("identical_file_tip", ""), - ("Show monitors in menu bar", ""), + ("show_monitors_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sk.rs b/src/lang/sk.rs index 16c70f7c..43d1539a 100644 --- a/src/lang/sk.rs +++ b/src/lang/sk.rs @@ -478,6 +478,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Password", ""), ("Me", ""), ("identical_file_tip", ""), - ("Show monitors in menu bar", ""), + ("show_monitors_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sl.rs b/src/lang/sl.rs index 90a6ee45..56539fa7 100755 --- a/src/lang/sl.rs +++ b/src/lang/sl.rs @@ -478,6 +478,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Password", ""), ("Me", ""), ("identical_file_tip", ""), - ("Show monitors in menu bar", ""), + ("show_monitors_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sq.rs b/src/lang/sq.rs index 25dd55f8..65e18b51 100644 --- a/src/lang/sq.rs +++ b/src/lang/sq.rs @@ -478,6 +478,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Password", ""), ("Me", ""), ("identical_file_tip", ""), - ("Show monitors in menu bar", ""), + ("show_monitors_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sr.rs b/src/lang/sr.rs index b07cca46..c16a0c03 100644 --- a/src/lang/sr.rs +++ b/src/lang/sr.rs @@ -478,6 +478,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Password", ""), ("Me", ""), ("identical_file_tip", ""), - ("Show monitors in menu bar", ""), + ("show_monitors_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sv.rs b/src/lang/sv.rs index abc34482..b5529c05 100644 --- a/src/lang/sv.rs +++ b/src/lang/sv.rs @@ -478,6 +478,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Password", ""), ("Me", ""), ("identical_file_tip", ""), - ("Show monitors in menu bar", ""), + ("show_monitors_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/template.rs b/src/lang/template.rs index c0adc7a2..4f29f7dc 100644 --- a/src/lang/template.rs +++ b/src/lang/template.rs @@ -478,6 +478,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Password", ""), ("Me", ""), ("identical_file_tip", ""), - ("Show monitors in menu bar", ""), + ("show_monitors_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/th.rs b/src/lang/th.rs index 63456778..72355ee5 100644 --- a/src/lang/th.rs +++ b/src/lang/th.rs @@ -478,6 +478,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Password", ""), ("Me", ""), ("identical_file_tip", ""), - ("Show monitors in menu bar", ""), + ("show_monitors_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/tr.rs b/src/lang/tr.rs index b68e2f3e..ba4c33be 100644 --- a/src/lang/tr.rs +++ b/src/lang/tr.rs @@ -478,6 +478,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Password", ""), ("Me", ""), ("identical_file_tip", ""), - ("Show monitors in menu bar", ""), + ("show_monitors_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/tw.rs b/src/lang/tw.rs index d314f5f6..90cb0bf6 100644 --- a/src/lang/tw.rs +++ b/src/lang/tw.rs @@ -478,6 +478,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Password", ""), ("Me", ""), ("identical_file_tip", ""), - ("Show monitors in menu bar", ""), + ("show_monitors_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ua.rs b/src/lang/ua.rs index 62a7382e..68b46e70 100644 --- a/src/lang/ua.rs +++ b/src/lang/ua.rs @@ -478,6 +478,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Password", ""), ("Me", ""), ("identical_file_tip", ""), - ("Show monitors in menu bar", ""), + ("show_monitors_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/vn.rs b/src/lang/vn.rs index 4f94c5a3..43e33933 100644 --- a/src/lang/vn.rs +++ b/src/lang/vn.rs @@ -478,6 +478,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Empty Password", ""), ("Me", ""), ("identical_file_tip", ""), - ("Show monitors in menu bar", ""), + ("show_monitors_tip", ""), ].iter().cloned().collect(); } From 67c1f266e3c83b171e9c255ad9c5fc4caa9700f1 Mon Sep 17 00:00:00 2001 From: NicKoehler Date: Wed, 15 Mar 2023 18:43:43 +0100 Subject: [PATCH 5/5] Fix wrong logic --- flutter/lib/desktop/widgets/remote_toolbar.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flutter/lib/desktop/widgets/remote_toolbar.dart b/flutter/lib/desktop/widgets/remote_toolbar.dart index d836c4ab..41c2ef21 100644 --- a/flutter/lib/desktop/widgets/remote_toolbar.dart +++ b/flutter/lib/desktop/widgets/remote_toolbar.dart @@ -393,7 +393,7 @@ class _RemoteMenubarState extends State { toolbarItems.add(_MobileActionMenu(ffi: widget.ffi)); } - if (PrivacyModeState.find(widget.id).isTrue || + if (PrivacyModeState.find(widget.id).isFalse && stateGlobal.displaysCount.value > 1) { toolbarItems.add( bind.mainGetUserDefaultOption(key: 'show_monitors_menubar') == 'Y'