PowerToys/src/core/Microsoft.PowerToys.Settings.UI/Views/GeneralPage.xaml

116 lines
5.4 KiB
Plaintext
Raw Normal View History

<Page
x:Class="Microsoft.PowerToys.Settings.UI.Views.GeneralPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Views"
xmlns:viewModel="using:Microsoft.PowerToys.Settings.UI.ViewModels"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Page.Resources>
<viewModel:GeneralViewModel x:Key="eventViewModel"/>
</Page.Resources>
<Grid ColumnSpacing="{StaticResource DefaultColumnSpacing}" RowSpacing="{StaticResource DefaultRowSpacing}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="LayoutVisualStates">
<VisualState x:Name="WideLayout">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="{StaticResource WideLayoutMinWidth}" />
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="SidePanel.(Grid.Column)" Value="1" />
<Setter Target="SidePanel.(Grid.Row)" Value="0" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="SmallLayout">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="{StaticResource SmallLayoutMinWidth}" />
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="SidePanel.(Grid.Column)" Value="0" />
<Setter Target="SidePanel.(Grid.Row)" Value="1" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<StackPanel Orientation="Vertical"
x:Name="GeneralSettingsView">
<ToggleSwitch x:Uid="GeneralPage_ToggleSwitch_RunAtStartUp"
Margin="{StaticResource SmallTopMargin}"
IsOn="{Binding Mode=TwoWay, Path=Startup}"/>
<muxc:RadioButtons x:Uid="RadioButtons_Name_Theme" Margin="{StaticResource SmallTopMargin}">
<RadioButton x:Uid="GeneralPage_Radio_Theme_Dark"
Content="Dark"
IsChecked="{ Binding Mode=TwoWay, Path=IsDarkThemeRadioButtonChecked}"/>
<RadioButton x:Uid="GeneralPage_Radio_Theme_Light"
Content="Light"
IsChecked="{ Binding Mode=TwoWay, Path=IsLightThemeRadioButtonChecked}"/>
<RadioButton x:Uid="GeneralPage_Radio_Theme_Default"
Content="System default"
IsChecked="{ Binding Mode=TwoWay, Path=IsSystemThemeRadioButtonChecked}"/>
</muxc:RadioButtons>
<Button x:Uid="GeneralPage_RestartAsAdmin_Button"
Margin="{StaticResource SmallTopMargin}"
Style="{StaticResource AccentButtonStyle}"
Command = "{Binding RestartElevatedButtonEventHandler, Source={StaticResource eventViewModel}}"
/>
</StackPanel>
<StackPanel x:Name="SidePanel"
Orientation="Vertical"
HorizontalAlignment="Left"
Width="{StaticResource SidePanelWidth}"
Grid.Column="1">
<TextBlock x:Uid="GeneralPage_AboutPowerToysHeader"
Style="{StaticResource SettingsGroupTitleStyle}"
Margin="{StaticResource XSmallBottomMargin}"/>
<TextBlock Text="Version 0.15.2"
FontWeight="Bold"
Margin="{StaticResource SmallTopMargin}" />
<Button x:Uid="GeneralPage_CheckForUpdates"
Margin="{StaticResource SmallTopMargin}"
Style="{StaticResource AccentButtonStyle}"
Foreground="White"
Command = "{Binding CheckFoUpdatesEventHandler, Source={StaticResource eventViewModel}}"
/>
<HyperlinkButton x:Uid="GeneralPage_ReportAbug"
NavigateUri="https://github.com/microsoft/PowerToys/issues"
Margin="{StaticResource SmallTopMargin}" />
<HyperlinkButton x:Uid="GeneralPage_RequestAFeature_URL"
NavigateUri="https://github.com/microsoft/PowerToys/issues"/>
<HyperlinkButton x:Uid="GeneralPage_PrivacyStatement_URL"
NavigateUri=" http://go.microsoft.com/fwlink/?LinkId=521839" />
<HyperlinkButton x:Uid="OpenSource_Notice"
NavigateUri="https://github.com/microsoft/PowerToys/blob/master/NOTICE.md"
/>
</StackPanel>
</Grid>
</Page>