diff --git a/flutter/lib/common/widgets/toolbar.dart b/flutter/lib/common/widgets/toolbar.dart index a3b67b752338..2789bc6b87a1 100644 --- a/flutter/lib/common/widgets/toolbar.dart +++ b/flutter/lib/common/widgets/toolbar.dart @@ -92,18 +92,21 @@ List toolbarControls(BuildContext context, String id, FFI ffi) { TTextMenu( child: Row(children: [ Text(translate(pi.isHeadless ? 'OS Account' : 'OS Password')), - Offstage( - offstage: isDesktop, - child: Icon(Icons.edit, color: MyTheme.accent).marginOnly(left: 12), - ) ]), trailingIcon: Transform.scale( - scale: 0.8, - child: InkWell( - onTap: () => pi.isHeadless - ? showSetOSAccount(sessionId, ffi.dialogManager) - : handleOsPasswordEditIcon(sessionId, ffi.dialogManager), - child: Icon(Icons.edit), + scale: isDesktop ? 0.8 : 1, + child: IconButton( + onPressed: () { + if (isMobile && Navigator.canPop(context)) { + Navigator.pop(context); + } + if (pi.isHeadless) { + showSetOSAccount(sessionId, ffi.dialogManager); + } else { + handleOsPasswordEditIcon(sessionId, ffi.dialogManager); + } + }, + icon: Icon(Icons.edit, color: isMobile ? MyTheme.accent : null), ), ), onPressed: () => pi.isHeadless diff --git a/flutter/lib/mobile/pages/remote_page.dart b/flutter/lib/mobile/pages/remote_page.dart index 4cf0bed85944..8db585cceb74 100644 --- a/flutter/lib/mobile/pages/remote_page.dart +++ b/flutter/lib/mobile/pages/remote_page.dart @@ -494,10 +494,23 @@ class _RemotePageState extends State { final x = 120.0; final y = size.height; final menus = toolbarControls(context, id, gFFI); + getChild(TTextMenu menu) { + if (menu.trailingIcon != null) { + return Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + menu.child, + menu.trailingIcon!, + ]); + } else { + return menu.child; + } + } + final more = menus .asMap() .entries - .map((e) => PopupMenuItem(child: e.value.child, value: e.key)) + .map((e) => PopupMenuItem(child: getChild(e.value), value: e.key)) .toList(); () async { var index = await showMenu(