Do not enable privacy mode if current display is not the primary one

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2023-03-06 16:41:26 +08:00
parent 507472e87e
commit 8032659841
34 changed files with 45 additions and 2 deletions

View File

@@ -509,7 +509,8 @@ class _MonitorMenu extends StatelessWidget {
@override
Widget build(BuildContext context) {
if (PrivacyModeState.find(id).isTrue || stateGlobal.displaysCount.value < 2) {
if (PrivacyModeState.find(id).isTrue ||
stateGlobal.displaysCount.value < 2) {
return Offstage();
}
return _IconSubmenuButton(
@@ -1548,6 +1549,16 @@ class _DisplayMenuState extends State<_DisplayMenu> {
value: rxValue.value,
onChanged: (value) {
if (value == null) return;
if (widget.ffi.ffiModel.pi.currentDisplay != 0) {
msgBox(
widget.id,
'custom-nook-nocancel-hasclose',
'info',
'Please switch to Display 1 first',
'',
widget.ffi.dialogManager);
return;
}
bind.sessionToggleOption(id: widget.id, value: option);
},
ffi: widget.ffi,