From b2f4ba0882acc5cee92b42fc7ad73755aed7ef0b Mon Sep 17 00:00:00 2001 From: 21pages Date: Wed, 22 May 2024 15:07:47 +0800 Subject: [PATCH] fix cursor menu divider and Auto (null) (#8116) Signed-off-by: 21pages --- flutter/lib/common/widgets/toolbar.dart | 4 ++-- .../lib/desktop/widgets/remote_toolbar.dart | 19 ++++++++++--------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/flutter/lib/common/widgets/toolbar.dart b/flutter/lib/common/widgets/toolbar.dart index 691bc4e7e..b68c0180f 100644 --- a/flutter/lib/common/widgets/toolbar.dart +++ b/flutter/lib/common/widgets/toolbar.dart @@ -362,7 +362,8 @@ Future>> toolbarCodec( } var autoLabel = translate('Auto'); - if (groupValue == 'auto') { + if (groupValue == 'auto' && + ffi.qualityMonitorModel.data.codecFormat != null) { autoLabel = '$autoLabel (${ffi.qualityMonitorModel.data.codecFormat})'; } return [ @@ -380,7 +381,6 @@ Future> toolbarCursor( List v = []; final ffiModel = ffi.ffiModel; final pi = ffiModel.pi; - final perms = ffiModel.permissions; final sessionId = ffi.sessionId; // show remote cursor diff --git a/flutter/lib/desktop/widgets/remote_toolbar.dart b/flutter/lib/desktop/widgets/remote_toolbar.dart index 609ebbb1c..3d2486420 100644 --- a/flutter/lib/desktop/widgets/remote_toolbar.dart +++ b/flutter/lib/desktop/widgets/remote_toolbar.dart @@ -1067,7 +1067,6 @@ class _DisplayMenuState extends State<_DisplayMenu> { id: widget.id, ffi: widget.ffi, ), - Divider(), cursorToggles(), Divider(), toggles(), @@ -1219,14 +1218,16 @@ class _DisplayMenuState extends State<_DisplayMenu> { hasData: (data) { final v = data as List; if (v.isEmpty) return Offstage(); - return Column( - children: v - .map((e) => CkbMenuButton( - value: e.value, - onChanged: e.onChanged, - child: e.child, - ffi: ffi)) - .toList()); + return Column(children: [ + Divider(), + ...v + .map((e) => CkbMenuButton( + value: e.value, + onChanged: e.onChanged, + child: e.child, + ffi: ffi)) + .toList(), + ]); }); }