mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-03 09:46:54 +02:00
Added OOBE
This commit is contained in:
@@ -123,6 +123,9 @@
|
||||
<Compile Include="OOBE\Enums\PowerToysModulesEnum.cs" />
|
||||
<Compile Include="OOBE\ViewModel\OobeShellViewModel.cs" />
|
||||
<Compile Include="OOBE\ViewModel\OobePowerToysModule.cs" />
|
||||
<Compile Include="OOBE\Views\OobeEspresso.xaml.cs">
|
||||
<DependentUpon>OobeEspresso.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="OOBE\Views\OobeColorPicker.xaml.cs">
|
||||
<DependentUpon>OobeColorPicker.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -202,6 +205,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Assets\FluentIcons\FluentIconsColorPicker.png" />
|
||||
<Content Include="Assets\FluentIcons\FluentIconsEspresso.png" />
|
||||
<Content Include="Assets\FluentIcons\FluentIconsFancyZones.png" />
|
||||
<Content Include="Assets\FluentIcons\FluentIconsFileExplorerPreview.png" />
|
||||
<Content Include="Assets\FluentIcons\FluentIconsImageResizer.png" />
|
||||
@@ -299,6 +303,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="OOBE\Views\OobeEspresso.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="OOBE\Views\OobeColorPicker.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
|
||||
@@ -8,6 +8,7 @@ namespace Microsoft.PowerToys.Settings.UI.OOBE.Enums
|
||||
{
|
||||
Overview = 0,
|
||||
ColorPicker,
|
||||
Espresso,
|
||||
FancyZones,
|
||||
FileExplorer,
|
||||
ImageResizer,
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
<Page x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobeEspresso"
|
||||
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.OOBE.Views"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d"
|
||||
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="280" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Image Stretch="UniformToFill"
|
||||
Source="{x:Bind ViewModel.PreviewImageSource}" />
|
||||
|
||||
<ScrollViewer Grid.Row="1"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
<StackPanel Orientation="Vertical"
|
||||
Margin="{StaticResource OobePageContentMargin}"
|
||||
VerticalAlignment="Top">
|
||||
|
||||
<TextBlock Text="{x:Bind ViewModel.ModuleName}"
|
||||
AutomationProperties.HeadingLevel="Level2"
|
||||
Style="{StaticResource PageTitleStyle}" />
|
||||
|
||||
<TextBlock TextWrapping="Wrap"
|
||||
Margin="0,4,0,0"
|
||||
Text="{x:Bind ViewModel.Description}" />
|
||||
|
||||
<HyperlinkButton NavigateUri="{x:Bind ViewModel.Link}" Margin="0,0,0,4">
|
||||
<TextBlock>
|
||||
<Run x:Uid="Oobe_LearnMore" />
|
||||
<Run Text="{x:Bind ViewModel.ModuleName}" />
|
||||
</TextBlock>
|
||||
</HyperlinkButton>
|
||||
|
||||
<TextBlock x:Uid="Oobe_HowToUse"
|
||||
AutomationProperties.HeadingLevel="Level3"
|
||||
Style="{StaticResource OobeSubtitleStyle}" />
|
||||
|
||||
<controls:ShortcutTextControl x:Uid="Oobe_Espresso_HowToUse" />
|
||||
|
||||
<TextBlock x:Uid="Oobe_TipsAndTricks"
|
||||
AutomationProperties.HeadingLevel="Level3"
|
||||
Style="{StaticResource OobeSubtitleStyle}"/>
|
||||
|
||||
<controls:ShortcutTextControl x:Uid="Oobe_Espresso_TipsAndTricks" />
|
||||
|
||||
<StackPanel Orientation="Horizontal"
|
||||
Spacing="4"
|
||||
Margin="0,32,0,0">
|
||||
<Button Click="SettingsLaunchButton_Click"
|
||||
AutomationProperties.LabeledBy="{Binding ElementName=SettingsLabel}">
|
||||
<StackPanel Orientation="Horizontal"
|
||||
Spacing="8">
|
||||
<TextBlock Text=""
|
||||
Margin="0,3,0,0"
|
||||
FontFamily="Segoe MDL2 Assets" />
|
||||
<TextBlock x:Uid="OOBE_Settings" Name="SettingsLabel" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
</Page>
|
||||
@@ -0,0 +1,48 @@
|
||||
// Copyright (c) Microsoft Corporation
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System.Threading;
|
||||
using Microsoft.PowerToys.Settings.UI.OOBE.Enums;
|
||||
using Microsoft.PowerToys.Settings.UI.OOBE.ViewModel;
|
||||
using Microsoft.PowerToys.Settings.UI.Views;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Navigation;
|
||||
|
||||
namespace Microsoft.PowerToys.Settings.UI.OOBE.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// An empty page that can be used on its own or navigated to within a Frame.
|
||||
/// </summary>
|
||||
public sealed partial class OobeEspresso : Page
|
||||
{
|
||||
public OobePowerToysModule ViewModel { get; set; }
|
||||
|
||||
public OobeEspresso()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
ViewModel = new OobePowerToysModule(OobeShellPage.OobeShellHandler.Modules[(int)PowerToysModulesEnum.Espresso]);
|
||||
DataContext = ViewModel;
|
||||
}
|
||||
|
||||
private void SettingsLaunchButton_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
|
||||
{
|
||||
if (OobeShellPage.OpenMainWindowCallback != null)
|
||||
{
|
||||
OobeShellPage.OpenMainWindowCallback(typeof(EspressoPage));
|
||||
}
|
||||
|
||||
ViewModel.LogOpeningSettingsEvent();
|
||||
}
|
||||
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
{
|
||||
ViewModel.LogOpeningModuleEvent();
|
||||
}
|
||||
|
||||
protected override void OnNavigatedFrom(NavigationEventArgs e)
|
||||
{
|
||||
ViewModel.LogClosingModuleEvent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -88,6 +88,18 @@ namespace Microsoft.PowerToys.Settings.UI.OOBE.Views
|
||||
Description = loader.GetString("Oobe_ColorPicker_Description"),
|
||||
Link = "https://aka.ms/PowerToysOverview_ColorPicker",
|
||||
});
|
||||
Modules.Insert((int)PowerToysModulesEnum.Espresso, new OobePowerToysModule()
|
||||
{
|
||||
ModuleName = loader.GetString("Oobe_Espresso"),
|
||||
Tag = "Espresso",
|
||||
IsNew = false,
|
||||
Icon = "\uEC32",
|
||||
Image = "ms-appx:///Assets/Modules/Espresso.png",
|
||||
FluentIcon = "ms-appx:///Assets/FluentIcons/FluentIconsEspresso.png",
|
||||
PreviewImageSource = "ms-appx:///Assets/Modules/OOBE/FancyZones.gif",
|
||||
Description = loader.GetString("Oobe_Espresso_Description"),
|
||||
Link = "https://aka.ms/PowerToysOverview_Espresso",
|
||||
});
|
||||
Modules.Insert((int)PowerToysModulesEnum.FancyZones, new OobePowerToysModule()
|
||||
{
|
||||
ModuleName = loader.GetString("Oobe_FancyZones"),
|
||||
@@ -211,6 +223,7 @@ namespace Microsoft.PowerToys.Settings.UI.OOBE.Views
|
||||
{
|
||||
case "Overview": NavigationFrame.Navigate(typeof(OobeOverview)); break;
|
||||
case "ColorPicker": NavigationFrame.Navigate(typeof(OobeColorPicker)); break;
|
||||
case "Espresso": NavigationFrame.Navigate(typeof(OobeEspresso)); break;
|
||||
case "FancyZones": NavigationFrame.Navigate(typeof(OobeFancyZones)); break;
|
||||
case "Run": NavigationFrame.Navigate(typeof(OobeRun)); break;
|
||||
case "ImageResizer": NavigationFrame.Navigate(typeof(OobeImageResizer)); break;
|
||||
|
||||
@@ -1208,4 +1208,17 @@ From there, simply click on a Markdown file or SVG icon in the File Explorer and
|
||||
<value>https://espresso.den.dev</value>
|
||||
<comment>URL. Do not loc</comment>
|
||||
</data>
|
||||
<data name="Oobe_Espresso" xml:space="preserve">
|
||||
<value>Espresso</value>
|
||||
<comment>Module name, do not loc</comment>
|
||||
</data>
|
||||
<data name="Oobe_Espresso_Description" xml:space="preserve">
|
||||
<value>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</value>
|
||||
</data>
|
||||
<data name="Oobe_Espresso_HowToUse.Text" xml:space="preserve">
|
||||
<value>Open PowerToys Settings and {turn on Espresso}</value>
|
||||
</data>
|
||||
<data name="Oobe_Espresso_TipsAndTricks.Text" xml:space="preserve">
|
||||
<value>You can always change modes quickly by clicking the {Espresso icon in the system tray}</value>
|
||||
</data>
|
||||
</root>
|
||||
Reference in New Issue
Block a user