<Page
    x:Class="Microsoft.PowerToys.Settings.UI.Views.PowerAccentPage"
    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:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:tkcontrols="using:CommunityToolkit.WinUI.Controls"
    xmlns:ui="using:CommunityToolkit.WinUI"
    AutomationProperties.LandmarkType="Main"
    mc:Ignorable="d">

    <controls:SettingsPageControl
        x:Uid="QuickAccent"
        IsTabStop="False"
        ModuleImageSource="ms-appx:///Assets/Settings/Modules/QuickAccent.png">
        <controls:SettingsPageControl.ModuleContent>
            <StackPanel ChildrenTransitions="{StaticResource SettingsCardsAnimations}" Orientation="Vertical">
                <tkcontrols:SettingsCard
                    x:Uid="QuickAccent_EnableQuickAccent"
                    HeaderIcon="{ui:BitmapIcon Source=/Assets/Settings/Icons/QuickAccent.png}"
                    IsEnabled="{x:Bind ViewModel.IsEnabledGpoConfigured, Mode=OneWay, Converter={StaticResource BoolNegationConverter}}">
                    <ToggleSwitch x:Uid="ToggleSwitch" IsOn="{x:Bind ViewModel.IsEnabled, Mode=TwoWay}" />
                </tkcontrols:SettingsCard>

                <InfoBar
                    x:Uid="GPO_SettingIsManaged"
                    IsClosable="False"
                    IsOpen="{x:Bind ViewModel.IsEnabledGpoConfigured, Mode=OneWay}"
                    IsTabStop="{x:Bind ViewModel.IsEnabledGpoConfigured, Mode=OneWay}"
                    Severity="Informational" />

                <controls:SettingsGroup x:Uid="QuickAccent_Activation_GroupSettings" IsEnabled="{x:Bind ViewModel.IsEnabled, Mode=OneWay}">
                    <tkcontrols:SettingsExpander
                        x:Uid="QuickAccent_Activation_Shortcut"
                        HeaderIcon="{ui:FontIcon Glyph=&#xEDA7;}"
                        IsExpanded="True">
                        <ComboBox MinWidth="{StaticResource SettingActionControlMinWidth}" SelectedIndex="{x:Bind Path=ViewModel.ActivationKey, Mode=TwoWay}">
                            <ComboBoxItem x:Uid="QuickAccent_Activation_Key_Arrows" />
                            <ComboBoxItem x:Uid="QuickAccent_Activation_Key_Space" />
                            <ComboBoxItem x:Uid="QuickAccent_Activation_Key_Either" />
                        </ComboBox>
                        <tkcontrols:SettingsExpander.Items>
                            <tkcontrols:SettingsCard ContentAlignment="Left">
                                <CheckBox x:Uid="QuickAccent_Prevent_Activation_On_Game_Mode" IsChecked="{x:Bind ViewModel.DoNotActivateOnGameMode, Mode=TwoWay}" />
                            </tkcontrols:SettingsCard>
                        </tkcontrols:SettingsExpander.Items>
                    </tkcontrols:SettingsExpander>
                </controls:SettingsGroup>

                <controls:SettingsGroup x:Uid="QuickAccent_Language" IsEnabled="{x:Bind ViewModel.IsEnabled, Mode=OneWay}">
                    <tkcontrols:SettingsCard x:Uid="QuickAccent_SelectedLanguage" HeaderIcon="{ui:FontIcon Glyph=&#xF2B7;}">
                        <ComboBox MinWidth="{StaticResource SettingActionControlMinWidth}" SelectedIndex="{x:Bind Path=ViewModel.SelectedLangIndex, Mode=TwoWay}">
                            <!--  These should be in the same order as the array items in PowerAccentViewModel.cs  -->
                            <ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_All" />
                            <ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Catalan" />
                            <ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Currency" />
                            <ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Croatian" />
                            <ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Czech" />
                            <ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Danish" />
                            <ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Gaeilge" />
                            <ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Gaidhlig" />
                            <ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Dutch" />
                            <ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Greek" />
                            <ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Estonian" />
                            <ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Finnish" />
                            <ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_French" />
                            <ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_German" />
                            <ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Hebrew" />
                            <ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Hungarian" />
                            <ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Icelandic" />
                            <ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Italian" />
                            <ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Kurdish" />
                            <ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Lithuanian" />
                            <ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Macedonian" />
                            <ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Maori" />
                            <ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Norwegian" />
                            <ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Pinyin" />
                            <ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Polish" />
                            <ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Portuguese" />
                            <ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Romanian" />
                            <ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Slovak" />
                            <ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Slovenian" />
                            <ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Spanish" />
                            <ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Serbian" />
                            <ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Swedish" />
                            <ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Turkish" />
                            <ComboBoxItem x:Uid="QuickAccent_SelectedLanguage_Welsh" />
                        </ComboBox>
                    </tkcontrols:SettingsCard>
                </controls:SettingsGroup>

                <controls:SettingsGroup x:Uid="QuickAccent_Toolbar" IsEnabled="{x:Bind ViewModel.IsEnabled, Mode=OneWay}">
                    <tkcontrols:SettingsCard x:Uid="QuickAccent_ToolbarPosition" HeaderIcon="{ui:FontIcon Glyph=&#xEC12;}">
                        <ComboBox MinWidth="{StaticResource SettingActionControlMinWidth}" SelectedIndex="{x:Bind Path=ViewModel.ToolbarPositionIndex, Mode=TwoWay}">
                            <ComboBoxItem x:Uid="QuickAccent_ToolbarPosition_TopCenter" />
                            <ComboBoxItem x:Uid="QuickAccent_ToolbarPosition_BottomCenter" />
                            <ComboBoxItem x:Uid="QuickAccent_ToolbarPosition_Left" />
                            <ComboBoxItem x:Uid="QuickAccent_ToolbarPosition_Right" />
                            <ComboBoxItem x:Uid="QuickAccent_ToolbarPosition_TopRightCorner" />
                            <ComboBoxItem x:Uid="QuickAccent_ToolbarPosition_TopLeftCorner" />
                            <ComboBoxItem x:Uid="QuickAccent_ToolbarPosition_BottomRightCorner" />
                            <ComboBoxItem x:Uid="QuickAccent_ToolbarPosition_BottomLeftCorner" />
                            <ComboBoxItem x:Uid="QuickAccent_ToolbarPosition_Center" />
                        </ComboBox>
                    </tkcontrols:SettingsCard>
                    <tkcontrols:SettingsCard x:Uid="QuickAccent_Description_Indicator" HeaderIcon="{ui:FontIcon Glyph=&#xE946;}">
                        <ToggleSwitch x:Uid="QuickAccent_UnicodeDescription_ToggleSwitch" IsOn="{x:Bind ViewModel.ShowUnicodeDescription, Mode=TwoWay}" />
                    </tkcontrols:SettingsCard>
                    <tkcontrols:SettingsCard x:Uid="QuickAccent_SortByUsageFrequency_Indicator" HeaderIcon="{ui:FontIcon Glyph=&#xE8CB;}">
                        <ToggleSwitch x:Uid="QuickAccent_SortByUsageFrequency_ToggleSwitch" IsOn="{x:Bind ViewModel.SortByUsageFrequency, Mode=TwoWay}" />
                    </tkcontrols:SettingsCard>
                    <tkcontrols:SettingsCard x:Uid="QuickAccent_StartSelectionFromTheLeft_Indicator" HeaderIcon="{ui:FontIcon Glyph=&#xE974;}">
                        <ToggleSwitch x:Uid="QuickAccent_StartSelectionFromTheLeft_ToggleSwitch" IsOn="{x:Bind ViewModel.StartSelectionFromTheLeft, Mode=TwoWay}" />
                    </tkcontrols:SettingsCard>
                </controls:SettingsGroup>

                <controls:SettingsGroup x:Uid="QuickAccent_Behavior" IsEnabled="{x:Bind ViewModel.IsEnabled, Mode=OneWay}">
                    <tkcontrols:SettingsCard x:Uid="QuickAccent_InputTimeMs" HeaderIcon="{ui:FontIcon Glyph=&#xE916;}">
                        <NumberBox
                            MinWidth="{StaticResource SettingActionControlMinWidth}"
                            LargeChange="100"
                            Minimum="100"
                            SmallChange="10"
                            SpinButtonPlacementMode="Compact"
                            Value="{x:Bind ViewModel.InputTimeMs, Mode=TwoWay}" />
                    </tkcontrols:SettingsCard>

                    <tkcontrols:SettingsExpander x:Uid="QuickAccent_ExcludedApps" HeaderIcon="{ui:FontIcon Glyph=&#xECE4;}">
                        <tkcontrols:SettingsExpander.Items>
                            <tkcontrols:SettingsCard HorizontalContentAlignment="Stretch" ContentAlignment="Vertical">
                                <TextBox
                                    x:Uid="QuickAccent_ExcludedApps_TextBoxControl"
                                    MinWidth="240"
                                    MinHeight="160"
                                    AcceptsReturn="True"
                                    ScrollViewer.IsVerticalRailEnabled="True"
                                    ScrollViewer.VerticalScrollBarVisibility="Visible"
                                    ScrollViewer.VerticalScrollMode="Enabled"
                                    Text="{x:Bind ViewModel.ExcludedApps, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                    TextWrapping="Wrap" />
                            </tkcontrols:SettingsCard>
                        </tkcontrols:SettingsExpander.Items>
                    </tkcontrols:SettingsExpander>
                </controls:SettingsGroup>
            </StackPanel>
        </controls:SettingsPageControl.ModuleContent>

        <controls:SettingsPageControl.PrimaryLinks>
            <controls:PageLink x:Uid="LearnMore_QuickAccent" Link="https://aka.ms/PowerToysOverview_QuickAccent" />
        </controls:SettingsPageControl.PrimaryLinks>
        <controls:SettingsPageControl.SecondaryLinks>
            <controls:PageLink Link="https://github.com/damienleroy/PowerAccent" Text="Damien Leroy's PowerAccent" />
        </controls:SettingsPageControl.SecondaryLinks>
    </controls:SettingsPageControl>
</Page>
