mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-12-12 19:17:58 +00:00
hide recording button if using av1
Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
@@ -434,7 +434,7 @@ class _RemoteToolbarState extends State<RemoteToolbar> {
|
||||
toolbarItems.add(_ChatMenu(id: widget.id, ffi: widget.ffi));
|
||||
toolbarItems.add(_VoiceCallMenu(id: widget.id, ffi: widget.ffi));
|
||||
}
|
||||
toolbarItems.add(_RecordMenu());
|
||||
toolbarItems.add(_RecordMenu(ffi: widget.ffi));
|
||||
toolbarItems.add(_CloseMenu(id: widget.id, ffi: widget.ffi));
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
@@ -1219,11 +1219,12 @@ class _ResolutionsMenuState extends State<_ResolutionsMenu> {
|
||||
}
|
||||
|
||||
for (final r in resolutions) {
|
||||
if (r.width == _localResolution!.width && r.height == _localResolution!.height) {
|
||||
if (r.width == _localResolution!.width &&
|
||||
r.height == _localResolution!.height) {
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1467,16 +1468,17 @@ class _VoiceCallMenu extends StatelessWidget {
|
||||
}
|
||||
|
||||
class _RecordMenu extends StatelessWidget {
|
||||
const _RecordMenu({Key? key}) : super(key: key);
|
||||
final FFI ffi;
|
||||
const _RecordMenu({Key? key, required this.ffi}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var ffi = Provider.of<FfiModel>(context);
|
||||
var ffiModel = Provider.of<FfiModel>(context);
|
||||
var recordingModel = Provider.of<RecordingModel>(context);
|
||||
final visible =
|
||||
recordingModel.start || ffi.permissions['recording'] != false;
|
||||
recordingModel.start || ffiModel.permissions['recording'] != false;
|
||||
if (!visible) return Offstage();
|
||||
return _IconMenuButton(
|
||||
final menuButton = _IconMenuButton(
|
||||
assetName: 'assets/rec.svg',
|
||||
tooltip: recordingModel.start
|
||||
? 'Stop session recording'
|
||||
@@ -1489,6 +1491,14 @@ class _RecordMenu extends StatelessWidget {
|
||||
? _ToolbarTheme.hoverRedColor
|
||||
: _ToolbarTheme.hoverBlueColor,
|
||||
);
|
||||
return ChangeNotifierProvider.value(
|
||||
value: ffi.qualityMonitorModel,
|
||||
child: Consumer<QualityMonitorModel>(
|
||||
builder: (context, model, child) => Offstage(
|
||||
// If already started, AV1->Hidden/Stop, Other->Start, same as actual
|
||||
offstage: model.data.codecFormat == 'AV1',
|
||||
child: menuButton,
|
||||
)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user