Files
PowerToys/src/settings-ui/Settings.UI/Views/VideoConference.xaml
pajawojciech 9876695cdb [Video Conference Mute] Push to Reverse (#24892)
* Add push to talk

* Fix multiple callback WM_KEYDOWN while holding shortcut

* Code review suggestions

* Rename feature

* Revert "Rename feature"

This reverts commit 82d64bf57c.

* Add switch and settings

* Change type of bool property. Handle settings.

* Description

* Update src/modules/videoconference/VideoConferenceModule/VideoConferenceModule.cpp

Always consume hotkey press

Co-authored-by: Andrey Nekrasov <yuyoyuppe@users.noreply.github.com>

---------

Co-authored-by: Andrey Nekrasov <yuyoyuppe@users.noreply.github.com>
2023-03-30 10:55:09 +02:00

202 lines
12 KiB
XML

<Page
x:Class="Microsoft.PowerToys.Settings.UI.Views.VideoConferencePage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
xmlns:converters="using:CommunityToolkit.WinUI.UI.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:labs="using:CommunityToolkit.Labs.WinUI"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="using:CommunityToolkit.WinUI.UI"
mc:Ignorable="d">
<Page.Resources>
<converters:StringVisibilityConverter
x:Name="EmptyToCollapsedConverter"
EmptyValue="Collapsed"
NotEmptyValue="Visible" />
<converters:StringVisibilityConverter
x:Name="EmptyToBoolConverter"
EmptyValue="False"
NotEmptyValue="True" />
</Page.Resources>
<controls:SettingsPageControl
x:Uid="VideoConference"
ModuleImageSource="ms-appx:///Assets/Modules/VideoConference.png">
<controls:SettingsPageControl.ModuleContent>
<StackPanel Orientation="Vertical" ChildrenTransitions="{StaticResource SettingsCardsAnimations}">
<InfoBar
x:Uid="VideoConference_DeprecationWarning"
IsClosable="False"
IsOpen="True"
IsTabStop="True"
Severity="Informational">
<InfoBar.ActionButton>
<HyperlinkButton
x:Uid="VideoConference_DeprecationWarningButton"
HorizontalAlignment="Right"
NavigateUri="https://github.com/microsoft/PowerToys/issues/21473"
Style="{StaticResource TextButtonStyle}" />
</InfoBar.ActionButton>
</InfoBar>
<labs:SettingsCard
x:Uid="VideoConference_Enable"
HeaderIcon="{ui:BitmapIcon Source=/Assets/FluentIcons/FluentIconsVideoConferenceMute.png}"
IsEnabled="{Binding Mode=OneWay, Path=IsElevated}">
<ToggleSwitch
x:Uid="ToggleSwitch"
IsOn="{Binding Mode=TwoWay, Path=IsEnabled}" />
</labs:SettingsCard>
<InfoBar
x:Uid="VideoConference_RunAsAdminRequired"
IsClosable="False"
IsOpen="{Binding Mode=OneWay, Path=IsElevated, Converter={StaticResource BoolNegationConverter}}"
IsTabStop="True"
Severity="Informational"/>
<InfoBar
x:Uid="GPO_IsSettingForced"
IsClosable="False"
IsOpen="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabledGpoConfigured}"
IsTabStop="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabledGpoConfigured}"
Severity="Informational" />
<controls:SettingsGroup
x:Uid="VideoConference_Shortcuts"
IsEnabled="{Binding Mode=OneWay, Path=IsEnabled}">
<labs:SettingsCard x:Uid="VideoConference_CameraAndMicrophoneMuteHotkeyControl_Header">
<controls:ShortcutControl
MinWidth="{StaticResource SettingActionControlMinWidth}"
HotkeySettings="{x:Bind Path=ViewModel.CameraAndMicrophoneMuteHotkey, Mode=TwoWay}" />
</labs:SettingsCard>
<labs:SettingsCard x:Uid="VideoConference_MicrophoneMuteHotkeyControl_Header">
<controls:ShortcutControl
MinWidth="{StaticResource SettingActionControlMinWidth}"
HotkeySettings="{x:Bind Path=ViewModel.MicrophoneMuteHotkey, Mode=TwoWay}" />
</labs:SettingsCard>
<labs:SettingsCard x:Uid="VideoConference_MicrophonePushToTalkHotkeyControl_Header">
<controls:ShortcutControl
MinWidth="{StaticResource SettingActionControlMinWidth}"
HotkeySettings="{x:Bind Path=ViewModel.MicrophonePushToTalkHotkey, Mode=TwoWay}" />
</labs:SettingsCard>
<labs:SettingsCard x:Uid="VideoConference_CameraMuteHotkeyControl_Header">
<controls:ShortcutControl
MinWidth="{StaticResource SettingActionControlMinWidth}"
HotkeySettings="{x:Bind Path=ViewModel.CameraMuteHotkey, Mode=TwoWay}" />
</labs:SettingsCard>
</controls:SettingsGroup>
<controls:SettingsGroup
x:Uid="VideoConference_Microphone"
IsEnabled="{Binding Mode=OneWay, Path=IsEnabled}">
<labs:SettingsCard
x:Uid="VideoConference_SelectedMicrophone"
HeaderIcon="{ui:FontIcon FontFamily={StaticResource SymbolThemeFontFamily}, Glyph=&#xE720;}">
<ComboBox
MinWidth="{StaticResource SettingActionControlMinWidth}"
ItemsSource="{Binding MicrophoneNames, Mode=OneTime}"
SelectedIndex="{Binding Path=SelectedMicrophoneIndex, Mode=TwoWay}" />
</labs:SettingsCard>
<labs:SettingsCard
x:Uid="VideoConference_PushToReverse">
<ToggleSwitch
x:Uid="PushToReverseSwitch"
IsOn="{x:Bind Mode=TwoWay, Path=ViewModel.PushToReverseEnabled}" />
</labs:SettingsCard>
</controls:SettingsGroup>
<controls:SettingsGroup
x:Uid="VideoConference_Camera"
IsEnabled="{Binding Mode=OneWay, Path=IsEnabled}">
<labs:SettingsExpander
x:Uid="VideoConference_SelectedCamera"
HeaderIcon="{ui:FontIcon FontFamily={StaticResource SymbolThemeFontFamily}, Glyph=&#xE960;}"
IsExpanded="True">
<ComboBox
MinWidth="{StaticResource SettingActionControlMinWidth}"
IsEnabled="{Binding Mode=TwoWay, Path=IsEnabled}"
ItemsSource="{Binding CameraNames, Mode=OneTime}"
SelectedIndex="{Binding Path=SelectedCameraIndex, Mode=TwoWay}" />
<labs:SettingsExpander.Items>
<labs:SettingsCard x:Uid="VideoConference_CameraOverlayImagePathHeader">
<StackPanel
Orientation="Horizontal"
Spacing="8">
<Button
x:Uid="VideoConference_CameraOverlayImageBrowse"
Command="{Binding Mode=OneWay, Path=SelectOverlayImage}" />
<Button
x:Uid="VideoConference_CameraOverlayImageClear"
Command="{Binding Mode=OneWay, Path=ClearOverlayImage}"
IsEnabled="{Binding Path=CameraImageOverlayPath, Mode=OneWay, Converter={StaticResource EmptyToBoolConverter}}" />
</StackPanel>
</labs:SettingsCard>
<labs:SettingsCard
Visibility="{Binding Path=CameraImageOverlayPath, Mode=OneWay, Converter={StaticResource EmptyToCollapsedConverter}}">
<Border
MaxHeight="100"
HorizontalAlignment="Right"
CornerRadius="4">
<Image
x:Uid="VideoConference_CameraOverlayImageAlt"
Source="{Binding Mode=OneWay, Path=CameraImageOverlayPath}"
ToolTipService.ToolTip="{Binding Mode=OneWay, Path=CameraImageOverlayPath}" />
</Border>
</labs:SettingsCard>
</labs:SettingsExpander.Items>
</labs:SettingsExpander>
</controls:SettingsGroup>
<controls:SettingsGroup
x:Uid="VideoConference_Toolbar"
IsEnabled="{Binding Mode=OneWay, Path=IsEnabled}">
<labs:SettingsExpander
x:Uid="VideoConference_ToolbarPosition"
IsExpanded="True">
<ComboBox
MinWidth="{StaticResource SettingActionControlMinWidth}"
SelectedIndex="{Binding Mode=TwoWay, Path=ToolbarPositionIndex}">
<ComboBoxItem x:Uid="VideoConference_ToolbarPosition_TopLeftCorner" />
<ComboBoxItem x:Uid="VideoConference_ToolbarPosition_TopCenter" />
<ComboBoxItem x:Uid="VideoConference_ToolbarPosition_TopRightCorner" />
<ComboBoxItem x:Uid="VideoConference_ToolbarPosition_BottomLeftCorner" />
<ComboBoxItem x:Uid="VideoConference_ToolbarPosition_BottomCenter" />
<ComboBoxItem x:Uid="VideoConference_ToolbarPosition_BottomRightCorner" />
</ComboBox>
<labs:SettingsExpander.Items>
<labs:SettingsCard x:Uid="VideoConference_ToolbarMonitor">
<ComboBox
MinWidth="{StaticResource SettingActionControlMinWidth}"
SelectedIndex="{Binding Mode=TwoWay, Path=ToolbarMonitorIndex}">
<ComboBoxItem x:Uid="VideoConference_ToolbarMonitor_Main" />
<ComboBoxItem x:Uid="VideoConference_ToolbarMonitor_All" />
</ComboBox>
</labs:SettingsCard>
<labs:SettingsCard x:Uid="VideoConference_ToolbarHide">
<ComboBox
MinWidth="{StaticResource SettingActionControlMinWidth}"
SelectedIndex="{Binding Mode=TwoWay, Path=ToolbarHideIndex}">
<ComboBoxItem x:Uid="VideoConference_ToolbarHideNever" />
<ComboBoxItem x:Uid="VideoConference_ToolbarHideUnmuted" />
<ComboBoxItem x:Uid="VideoConference_ToolbarHideMuted" />
</ComboBox>
</labs:SettingsCard>
</labs:SettingsExpander.Items>
</labs:SettingsExpander>
</controls:SettingsGroup>
</StackPanel>
</controls:SettingsPageControl.ModuleContent>
<controls:SettingsPageControl.PrimaryLinks>
<controls:PageLink
x:Uid="LearnMore_VCM"
Link="https://aka.ms/PowerToysOverview_VideoConference" />
</controls:SettingsPageControl.PrimaryLinks>
</controls:SettingsPageControl>
</Page>