[VCM]Add options to hide after timeout and startup action (#28658)

* VideoConference add new option ToolbarHide After timeout

* VideoConference add new behavior option startup action
This commit is contained in:
Quyen Le Van
2023-10-06 14:48:36 +07:00
committed by GitHub
parent 03ad83836d
commit 99882508bc
9 changed files with 148 additions and 12 deletions

View File

@@ -147,6 +147,22 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
case "When both camera and microphone are muted":
_toolbarHideIndex = 2;
break;
case "After timeout":
_toolbarHideIndex = 3;
break;
}
switch (Settings.Properties.StartupAction.Value)
{
case "Nothing":
_startupActionIndex = 0;
break;
case "Unmute":
_startupActionIndex = 1;
break;
case "Mute":
_startupActionIndex = 2;
break;
}
if (shouldSaveSettings)
@@ -176,6 +192,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
private int _toolbarPositionIndex;
private int _toolbarMonitorIndex;
private int _toolbarHideIndex;
private int _startupActionIndex;
private HotkeySettings _cameraAndMicrophoneMuteHotkey;
private HotkeySettings _microphoneMuteHotkey;
private HotkeySettings _microphonePushToTalkHotkey;
@@ -497,6 +514,9 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
case 2:
Settings.Properties.ToolbarHide.Value = "When both camera and microphone are muted";
break;
case 3:
Settings.Properties.ToolbarHide.Value = "After timeout";
break;
}
RaisePropertyChanged(nameof(ToolbarHideIndex));
@@ -504,6 +524,36 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
}
}
public int StartupActionIndex
{
get
{
return _startupActionIndex;
}
set
{
if (value != _startupActionIndex)
{
_startupActionIndex = value;
switch (_startupActionIndex)
{
case 0:
Settings.Properties.StartupAction.Value = "Nothing";
break;
case 1:
Settings.Properties.StartupAction.Value = "Unmute";
break;
case 2:
Settings.Properties.StartupAction.Value = "Mute";
break;
}
RaisePropertyChanged(nameof(_startupActionIndex));
}
}
}
public string GetSettingsSubPath()
{
return _settingsConfigFileFolder + (string.IsNullOrEmpty(_settingsConfigFileFolder) ? string.Empty : "\\") + ModuleName;