mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-03 09:46:54 +02:00
* Add variable support - initial version without UI * Add variable in template filename support in New+ * Fix XAML style * Addressed code review feedback
210 lines
13 KiB
XML
210 lines
13 KiB
XML
<Page
|
|
x:Class="Microsoft.PowerToys.Settings.UI.Views.NewPlusPage"
|
|
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:local="clr-namespace:Microsoft.PowerToys.Settings.UI.ViewModels"
|
|
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="NewPlus" ModuleImageSource="ms-appx:///Assets/Settings/Modules/NewPlus.png">
|
|
<controls:SettingsPageControl.ModuleContent>
|
|
<StackPanel
|
|
ChildrenTransitions="{StaticResource SettingsCardsAnimations}"
|
|
Orientation="Vertical"
|
|
Spacing="2">
|
|
<tkcontrols:SettingsCard
|
|
x:Uid="NewPlus_Enable_Toggle"
|
|
HeaderIcon="{ui:BitmapIcon Source=/Assets/Settings/Icons/NewPlus.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">
|
|
<InfoBar.IconSource>
|
|
<FontIconSource FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="" />
|
|
</InfoBar.IconSource>
|
|
</InfoBar>
|
|
|
|
<controls:SettingsGroup x:Uid="NewPlus_Templates" IsEnabled="{x:Bind ViewModel.IsEnabled, Mode=OneWay}">
|
|
<tkcontrols:SettingsCard
|
|
x:Uid="NewPlus_Templates_Location"
|
|
ActionIcon="{ui:FontIcon Glyph=}"
|
|
Command="{x:Bind ViewModel.OpenCurrentNewTemplateFolder}"
|
|
HeaderIcon="{ui:FontIcon Glyph=}"
|
|
IsClickEnabled="True">
|
|
<Button
|
|
x:Uid="NewPlus_Templates_Location_Change"
|
|
Command="{x:Bind ViewModel.PickAnotherNewTemplateFolder}"
|
|
Style="{ThemeResource AccentButtonStyle}" />
|
|
|
|
<tkcontrols:SettingsCard.Description>
|
|
<StackPanel>
|
|
<TextBlock Text="{x:Bind ViewModel.TemplateLocation, Mode=OneWay}" />
|
|
<HyperlinkButton x:Uid="NewPlus_Templates_Location_Learn_More" NavigateUri="https://aka.ms/PowerToysOverview_NewPlus_TemplatesLocation" />
|
|
</StackPanel>
|
|
</tkcontrols:SettingsCard.Description>
|
|
|
|
</tkcontrols:SettingsCard>
|
|
|
|
<InfoBar
|
|
x:Uid="NewPlus_TemplatesNotBackupAndRestoreWarning"
|
|
IsClosable="False"
|
|
IsOpen="{x:Bind ViewModel.IsEnabled, Mode=OneWay}"
|
|
IsTabStop="{x:Bind ViewModel.IsEnabled, Mode=OneWay}"
|
|
Severity="Informational" />
|
|
|
|
</controls:SettingsGroup>
|
|
|
|
<controls:SettingsGroup x:Uid="NewPlus_Display_Options" IsEnabled="{x:Bind ViewModel.IsEnabled, Mode=OneWay}">
|
|
<tkcontrols:SettingsCard x:Uid="NewPlus_Hide_File_Extension_Toggle" IsEnabled="{x:Bind ViewModel.IsHideFileExtSettingsCardEnabled, Mode=OneWay}">
|
|
<ToggleSwitch x:Uid="HideFileExtensionToggle" IsOn="{x:Bind ViewModel.HideFileExtension, Mode=TwoWay}" />
|
|
</tkcontrols:SettingsCard>
|
|
<InfoBar
|
|
x:Uid="GPO_SettingIsManaged"
|
|
IsClosable="False"
|
|
IsOpen="{x:Bind ViewModel.IsHideFileExtSettingGPOConfigured, Mode=OneWay}"
|
|
IsTabStop="{x:Bind ViewModel.IsHideFileExtSettingGPOConfigured, Mode=OneWay}"
|
|
Severity="Informational">
|
|
<InfoBar.IconSource>
|
|
<FontIconSource FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="" />
|
|
</InfoBar.IconSource>
|
|
</InfoBar>
|
|
<tkcontrols:SettingsCard x:Uid="NewPlus_Hide_Starting_Digits_Toggle">
|
|
<ToggleSwitch x:Uid="HideStartingDigitsToggle" IsOn="{x:Bind ViewModel.HideStartingDigits, Mode=TwoWay}" />
|
|
<tkcontrols:SettingsCard.Description>
|
|
<TextBlock x:Uid="NewPlus_Hide_Starting_Digits_Description" />
|
|
</tkcontrols:SettingsCard.Description>
|
|
</tkcontrols:SettingsCard>
|
|
</controls:SettingsGroup>
|
|
|
|
<controls:SettingsGroup x:Uid="NewPlus_behavior" IsEnabled="{x:Bind ViewModel.IsEnabled, Mode=OneWay}">
|
|
<tkcontrols:SettingsCard x:Uid="NewPlus_Behaviour_Replace_Variables_Toggle" IsEnabled="{x:Bind ViewModel.IsReplaceVariablesSettingsCardEnabled, Mode=OneWay}">
|
|
<StackPanel Orientation="Horizontal" Spacing="4">
|
|
<ToggleSwitch x:Uid="ReplaceVariablesToggle" IsOn="{x:Bind ViewModel.ReplaceVariables, Mode=TwoWay}" />
|
|
<Button
|
|
x:Uid="FileCreationButton"
|
|
Width="28"
|
|
Height="40"
|
|
Margin="0,0,-4,0"
|
|
Padding="0"
|
|
HorizontalAlignment="Right"
|
|
VerticalAlignment="Center"
|
|
Background="Transparent"
|
|
BorderBrush="Transparent"
|
|
Content=""
|
|
FontFamily="{ThemeResource SymbolThemeFontFamily}">
|
|
<Button.Flyout>
|
|
<Flyout x:Name="VariableExamplesFlyout" ShouldConstrainToRootBounds="False">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="62" />
|
|
<ColumnDefinition Width="300" />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<TextBlock
|
|
Grid.Row="0"
|
|
Grid.Column="0"
|
|
Text="$YYYY" />
|
|
<TextBlock
|
|
Grid.Row="0"
|
|
Grid.Column="1"
|
|
Margin="0,0,0,5"
|
|
TextWrapping="Wrap"><Run x:Uid="NewPlus_Year_YYYY_Variable_Description" /></TextBlock>
|
|
|
|
<TextBlock
|
|
Grid.Row="1"
|
|
Grid.Column="0"
|
|
Text="$MM" />
|
|
<TextBlock
|
|
Grid.Row="1"
|
|
Grid.Column="1"
|
|
Margin="0,0,0,5"
|
|
TextWrapping="Wrap"><Run x:Uid="NewPlus_Month_MM_Variable_Description" /></TextBlock>
|
|
|
|
<TextBlock
|
|
Grid.Row="2"
|
|
Grid.Column="0"
|
|
Text="$DD" />
|
|
<TextBlock
|
|
Grid.Row="2"
|
|
Grid.Column="1"
|
|
Margin="0,0,0,5"
|
|
TextWrapping="Wrap"><Run x:Uid="NewPlus_Day_DD_Variable_Description" /></TextBlock>
|
|
|
|
<TextBlock
|
|
Grid.Row="3"
|
|
Grid.Column="0"
|
|
Text="$hh" />
|
|
<TextBlock
|
|
Grid.Row="3"
|
|
Grid.Column="1"
|
|
Margin="0,0,0,5"
|
|
TextWrapping="Wrap"><Run x:Uid="NewPlus_Hour_hh_Variable_Description" /></TextBlock>
|
|
|
|
<TextBlock
|
|
Grid.Row="4"
|
|
Grid.Column="0"
|
|
Text="$mm" />
|
|
<TextBlock
|
|
Grid.Row="4"
|
|
Grid.Column="1"
|
|
Margin="0,0,0,5"
|
|
TextWrapping="Wrap"><Run x:Uid="NewPlus_Minute_mm_Variable_Description" /></TextBlock>
|
|
|
|
<TextBlock
|
|
Grid.Row="5"
|
|
Grid.Column="0"
|
|
Text="$ss" />
|
|
<TextBlock
|
|
Grid.Row="5"
|
|
Grid.Column="1"
|
|
Margin="0,0,0,0"
|
|
TextWrapping="Wrap"><Run x:Uid="NewPlus_Second_ss_Variable_Description" /></TextBlock>
|
|
</Grid>
|
|
</Flyout>
|
|
</Button.Flyout>
|
|
</Button>
|
|
</StackPanel>
|
|
<tkcontrols:SettingsCard.Description>
|
|
<StackPanel>
|
|
<HyperlinkButton x:Uid="NewPlus_Behaviour_Replace_Variables_Learn_More" NavigateUri="https://aka.ms/PowerToysOverview_NewPlus" />
|
|
</StackPanel>
|
|
</tkcontrols:SettingsCard.Description>
|
|
</tkcontrols:SettingsCard>
|
|
<InfoBar
|
|
x:Uid="GPO_SettingIsManaged"
|
|
IsClosable="False"
|
|
IsOpen="{x:Bind ViewModel.IsReplaceVariablesSettingGPOConfigured, Mode=OneWay}"
|
|
IsTabStop="{x:Bind ViewModel.IsReplaceVariablesSettingGPOConfigured, Mode=OneWay}"
|
|
Severity="Informational" />
|
|
</controls:SettingsGroup>
|
|
</StackPanel>
|
|
</controls:SettingsPageControl.ModuleContent>
|
|
|
|
<controls:SettingsPageControl.PrimaryLinks>
|
|
<controls:PageLink x:Uid="NewPlus_Learn_More" Link="https://aka.ms/PowerToysOverview_NewPlus" />
|
|
</controls:SettingsPageControl.PrimaryLinks>
|
|
<controls:SettingsPageControl.SecondaryLinks>
|
|
<controls:PageLink Link="https://www.linkedin.com/in/christian-gaardmark/" Text="Christian Gaardmark" />
|
|
</controls:SettingsPageControl.SecondaryLinks>
|
|
</controls:SettingsPageControl>
|
|
|
|
</Page>
|