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 000000000..c1d560b29 --- /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 4609d4f47..af7f7f968 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 d1189abe4..6cfbf4675 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 93d9c76fe..b086cbb01 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 bdc2257b3..aee739f84 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 651043850..9ebe4cff9 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 31ca52c11..478d7b925 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 09fad80eb..32f720f4b 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 923d4b64e..f62912cd4 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 57a519338..5403c8883 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 d15061286..d7c753096 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 be9821083..f3da03d21 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 5798253ad..06bc82bfe 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 672c65bbb..73e3c41a7 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 a6272dbd3..4c0fefd82 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 2333e23dd..b0728ddfb 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 5b1bcec4c..be6f337b0 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 3b31b631b..c0e729ba0 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 ccce435fc..18fee1e00 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 9574581e5..033e7b8d4 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 5534bbe1b..8b256a4c2 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 780bc46c6..d583daa9e 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 5cfc2e5a3..43ceb9a25 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 c354c4685..a9b82e788 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 3abea8029..1f5328638 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 820b7a7db..c1ea44554 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 e81124d5c..dd6050e57 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 d237b8895..1eedfdfad 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 8e7ecf824..d7c932cf0 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 e0807d892..49be9ef16 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 085ed025d..771ca4fcb 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 6b3e34e48..c1c55927a 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 c92044e39..c31789ee5 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 a16bf26b8..b123c73bc 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 302dd9166..5779617ba 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 e72be8ea5..55e294831 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 2099f2e95..2b1999b42 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 d810650fd..f9c30e8c1 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 8a1b2fbd6..d836c4ab2 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 585b784a6..7a8e5e437 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 ef2d6f50b..0781a2a97 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 ac0e9e6bb..03f8d6240 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 14bcc5158..cfb66528d 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 94e9832f1..ab1e2976b 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 6ab774b3c..e7defa943 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 389909245..eb09dacd2 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 0a5930412..2eb430d32 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 b144d6a8c..12a537216 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 3a9f58749..c6aa36d58 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 3a28bbb9d..b327972b7 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 2aa1558e5..b4df936bb 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 1927d582c..465f2082c 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 4ca577823..94fea4e03 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 31fa936ce..d5bd2e973 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 a857dd56f..83ba01915 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 4bcd4949d..de33f7e57 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 0dc7e6bb0..05fc9a65c 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 8a8f51abf..e93635ca5 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 603dd0d59..a2189a7b0 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 7eaaabd70..19db9e989 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 0b26f382d..382844fba 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 7c17c2b46..ee35e598a 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 16c70f7c9..43d1539a9 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 90a6ee459..56539fa74 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 25dd55f8d..65e18b517 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 b07cca46b..c16a0c039 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 abc344820..b5529c05b 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 c0adc7a2a..4f29f7dc3 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 63456778b..72355ee5d 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 b68e2f3e8..ba4c33bea 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 d314f5f6f..90cb0bf61 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 62a7382ed..68b46e700 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 4f94c5a38..43e339331 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 d836c4ab2..41c2ef21f 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'