[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

@@ -146,11 +146,22 @@
<ComboBoxItem x:Uid="VideoConference_ToolbarHideNever" />
<ComboBoxItem x:Uid="VideoConference_ToolbarHideUnmuted" />
<ComboBoxItem x:Uid="VideoConference_ToolbarHideMuted" />
<ComboBoxItem x:Uid="VideoConference_ToolbarHideTimeout" />
</ComboBox>
</controls:SettingsCard>
</controls:SettingsExpander.Items>
</controls:SettingsExpander>
</custom:SettingsGroup>
<custom:SettingsGroup x:Uid="VideoConference_Behavior" IsEnabled="{Binding Mode=OneWay, Path=IsEnabled}">
<controls:SettingsCard x:Uid="VideoConference_StartupAction">
<ComboBox MinWidth="{StaticResource SettingActionControlMinWidth}" SelectedIndex="{Binding Mode=TwoWay, Path=StartupActionIndex}">
<ComboBoxItem x:Uid="VideoConference_StartupActionNothing" />
<ComboBoxItem x:Uid="VideoConference_StartupActionUnmute" />
<ComboBoxItem x:Uid="VideoConference_StartupActionMute" />
</ComboBox>
</controls:SettingsCard>
</custom:SettingsGroup>
</StackPanel>
</custom:SettingsPageControl.ModuleContent>

View File

@@ -561,6 +561,9 @@
<data name="VideoConference_ToolbarHideUnmuted.Content" xml:space="preserve">
<value>When both camera and microphone are unmuted</value>
</data>
<data name="VideoConference_ToolbarHideTimeout.Content" xml:space="preserve">
<value>After timeout</value>
</data>
<data name="VideoConference.ModuleTitle" xml:space="preserve">
<value>Video Conference Mute</value>
</data>
@@ -576,6 +579,21 @@
<data name="VideoConference_Toolbar.Header" xml:space="preserve">
<value>Toolbar</value>
</data>
<data name="VideoConference_Behavior.Header" xml:space="preserve">
<value>Behavior</value>
</data>
<data name="VideoConference_StartupAction.Header" xml:space="preserve">
<value>Startup action</value>
</data>
<data name="VideoConference_StartupActionNothing.Content" xml:space="preserve">
<value>Nothing</value>
</data>
<data name="VideoConference_StartupActionUnmute.Content" xml:space="preserve">
<value>Unmute</value>
</data>
<data name="VideoConference_StartupActionMute.Content" xml:space="preserve">
<value>Mute</value>
</data>
<data name="VideoConference_Shortcuts.Header" xml:space="preserve">
<value>Shortcuts</value>
</data>

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;