fix cursor menu divider and Auto (null) (#8116)

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages 2024-05-22 15:07:47 +08:00 committed by GitHub
parent 1acd7bd19c
commit b2f4ba0882
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 11 deletions

View File

@ -362,7 +362,8 @@ Future<List<TRadioMenu<String>>> 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<List<TToggleMenu>> toolbarCursor(
List<TToggleMenu> v = [];
final ffiModel = ffi.ffiModel;
final pi = ffiModel.pi;
final perms = ffiModel.permissions;
final sessionId = ffi.sessionId;
// show remote cursor

View File

@ -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<TToggleMenu>;
if (v.isEmpty) return Offstage();
return Column(
children: v
return Column(children: [
Divider(),
...v
.map((e) => CkbMenuButton(
value: e.value,
onChanged: e.onChanged,
child: e.child,
ffi: ffi))
.toList());
.toList(),
]);
});
}