mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-02-22 11:09:42 +01:00
Compare commits
28 Commits
async-cpp-
...
stefan/lan
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a6bc3b5307 | ||
|
|
d20debbb13 | ||
|
|
e0e42a0224 | ||
|
|
94cfccb747 | ||
|
|
d4e59b5ca1 | ||
|
|
b360497ba9 | ||
|
|
4f5273f76a | ||
|
|
26b25ce3b4 | ||
|
|
851302041d | ||
|
|
187bf580c7 | ||
|
|
f517a10533 | ||
|
|
c29f49ed0f | ||
|
|
8ddcc523a6 | ||
|
|
1cd63ae6ce | ||
|
|
1ea8280436 | ||
|
|
321c8a6f54 | ||
|
|
4db87edfc4 | ||
|
|
a280f3dd90 | ||
|
|
2c798c168e | ||
|
|
d844c4d142 | ||
|
|
d150230597 | ||
|
|
4afa8a8958 | ||
|
|
0e6e02f147 | ||
|
|
de76797885 | ||
|
|
b517d9bb79 | ||
|
|
9e53c99cbb | ||
|
|
f34108bd43 | ||
|
|
ed797076b8 |
@@ -266,6 +266,7 @@
|
|||||||
"Vanara.PInvoke.User32.dll",
|
"Vanara.PInvoke.User32.dll",
|
||||||
"WinUI3Apps\\clrcompression.dll",
|
"WinUI3Apps\\clrcompression.dll",
|
||||||
"WinUI3Apps\\Microsoft.Graphics.Canvas.Interop.dll",
|
"WinUI3Apps\\Microsoft.Graphics.Canvas.Interop.dll",
|
||||||
|
"WinUI3Apps\\WinUI3Localizer.dll",
|
||||||
"Microsoft.Web.WebView2.Core.dll",
|
"Microsoft.Web.WebView2.Core.dll",
|
||||||
"Microsoft.Web.WebView2.WinForms.dll",
|
"Microsoft.Web.WebView2.WinForms.dll",
|
||||||
"Microsoft.Web.WebView2.Wpf.dll",
|
"Microsoft.Web.WebView2.Wpf.dll",
|
||||||
|
|||||||
@@ -65,6 +65,7 @@
|
|||||||
<PackageVersion Include="UnitsNet" Version="4.145.0" />
|
<PackageVersion Include="UnitsNet" Version="4.145.0" />
|
||||||
<PackageVersion Include="Vanara.PInvoke.User32" Version="3.4.11" />
|
<PackageVersion Include="Vanara.PInvoke.User32" Version="3.4.11" />
|
||||||
<PackageVersion Include="Vanara.PInvoke.Shell32" Version="3.4.11" />
|
<PackageVersion Include="Vanara.PInvoke.Shell32" Version="3.4.11" />
|
||||||
|
<PackageVersion Include="WinUI3Localizer" Version="1.0.1" />
|
||||||
<PackageVersion Include="WinUIEx" Version="2.2.0" />
|
<PackageVersion Include="WinUIEx" Version="2.2.0" />
|
||||||
<PackageVersion Include="WPF-UI" Version="3.0.0-preview.4" />
|
<PackageVersion Include="WPF-UI" Version="3.0.0-preview.4" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@@ -92,6 +92,7 @@
|
|||||||
<RemoveFolder Id="RemoveBaseApplicationsAssetsFolder" Directory="BaseApplicationsAssetsFolder" On="uninstall"/>
|
<RemoveFolder Id="RemoveBaseApplicationsAssetsFolder" Directory="BaseApplicationsAssetsFolder" On="uninstall"/>
|
||||||
<RemoveFolder Id="RemoveWinUI3AppsInstallFolder" Directory="WinUI3AppsInstallFolder" On="uninstall"/>
|
<RemoveFolder Id="RemoveWinUI3AppsInstallFolder" Directory="WinUI3AppsInstallFolder" On="uninstall"/>
|
||||||
<RemoveFolder Id="RemoveWinUI3AppsAssetsFolder" Directory="WinUI3AppsAssetsFolder" On="uninstall"/>
|
<RemoveFolder Id="RemoveWinUI3AppsAssetsFolder" Directory="WinUI3AppsAssetsFolder" On="uninstall"/>
|
||||||
|
<RemoveFolder Id="RemoveWinUI3AppsStringsFolder" Directory="WinUI3AppsStringsFolder" On="uninstall"/>
|
||||||
<RemoveFolder Id="RemoveINSTALLFOLDER" Directory="INSTALLFOLDER" On="uninstall"/>
|
<RemoveFolder Id="RemoveINSTALLFOLDER" Directory="INSTALLFOLDER" On="uninstall"/>
|
||||||
</Component>
|
</Component>
|
||||||
<ComponentRef Id="powertoys_exe" />
|
<ComponentRef Id="powertoys_exe" />
|
||||||
|
|||||||
@@ -367,8 +367,8 @@
|
|||||||
<Directory Id="WinUI3AppsMicrosoftUIXamlInstallFolder" Name="Microsoft.UI.Xaml">
|
<Directory Id="WinUI3AppsMicrosoftUIXamlInstallFolder" Name="Microsoft.UI.Xaml">
|
||||||
<Directory Id="WinUI3AppsMicrosoftUIXamlAssetsInstallFolder" Name="Assets" />
|
<Directory Id="WinUI3AppsMicrosoftUIXamlAssetsInstallFolder" Name="Assets" />
|
||||||
</Directory>
|
</Directory>
|
||||||
<Directory Id="WinUI3AppsAssetsFolder" Name="Assets">
|
<Directory Id="WinUI3AppsAssetsFolder" Name="Assets"/>
|
||||||
</Directory>
|
<Directory Id="WinUI3AppsStringsFolder" Name="Strings"/>
|
||||||
</Directory>
|
</Directory>
|
||||||
<Directory Id="ToolsFolder" Name="Tools"/>
|
<Directory Id="ToolsFolder" Name="Tools"/>
|
||||||
</Directory>
|
</Directory>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
<?define SettingsV2AssetsFiles=?>
|
<?define SettingsV2AssetsFiles=?>
|
||||||
<?define SettingsV2AssetsFilesPath=$(var.BinDir)WinUI3Apps\Assets\Settings\?>
|
<?define SettingsV2AssetsFilesPath=$(var.BinDir)WinUI3Apps\Assets\Settings\?>
|
||||||
|
<?define SettingsV2StringsFilesPath=$(var.BinDir)WinUI3Apps\Strings\Settings\?>
|
||||||
|
|
||||||
<?define SettingsV2AssetsModulesFiles=?>
|
<?define SettingsV2AssetsModulesFiles=?>
|
||||||
<?define SettingsV2AssetsModulesFilesPath=$(var.BinDir)WinUI3Apps\Assets\Settings\Modules\?>
|
<?define SettingsV2AssetsModulesFilesPath=$(var.BinDir)WinUI3Apps\Assets\Settings\Modules\?>
|
||||||
@@ -16,6 +17,12 @@
|
|||||||
<?define SettingsV2OOBEAssetsFluentIconsFiles=?>
|
<?define SettingsV2OOBEAssetsFluentIconsFiles=?>
|
||||||
<?define SettingsV2OOBEAssetsFluentIconsFilesPath=$(var.BinDir)WinUI3Apps\Assets\Settings\FluentIcons\?>
|
<?define SettingsV2OOBEAssetsFluentIconsFilesPath=$(var.BinDir)WinUI3Apps\Assets\Settings\FluentIcons\?>
|
||||||
|
|
||||||
|
<?ifdef env.IsPipeline?>
|
||||||
|
<?define LocLanguageList = cs-CZ;de-DE;en-US;es-ES;fr-FR;hu-HU;it-IT;ja-JP;ko-KR;nl-NL;pl-PL;pt-BR;pt-PT;ru-RU;sv-SE;tr-TR;zh-CN;zh-TW?>
|
||||||
|
<?else?>
|
||||||
|
<?define LocLanguageList = en-US?>
|
||||||
|
<?endif?>
|
||||||
|
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<DirectoryRef Id="WinUI3AppsAssetsFolder">
|
<DirectoryRef Id="WinUI3AppsAssetsFolder">
|
||||||
<Directory Id="SettingsV2AssetsInstallFolder" Name="Settings">
|
<Directory Id="SettingsV2AssetsInstallFolder" Name="Settings">
|
||||||
@@ -25,6 +32,86 @@
|
|||||||
</Directory>
|
</Directory>
|
||||||
</Directory>
|
</Directory>
|
||||||
</DirectoryRef>
|
</DirectoryRef>
|
||||||
|
|
||||||
|
<DirectoryRef Id="WinUI3AppsStringsFolder">
|
||||||
|
<Directory Id="SettingsStringsFolder" Name="Settings" />
|
||||||
|
</DirectoryRef>
|
||||||
|
|
||||||
|
<?foreach Language in $(var.LocLanguageList)?>
|
||||||
|
<!--NB: Ids can't contain hyphens-->
|
||||||
|
<?if $(var.Language) = cs-CZ?>
|
||||||
|
<?define IdSafeLanguage = cs_CZ?>
|
||||||
|
<?define CompGUID = 715E1991-43CC-4D32-98C8-5BBC9B649FD5?>
|
||||||
|
<?elseif $(var.Language) = de-DE?>
|
||||||
|
<?define IdSafeLanguage = de_DE?>
|
||||||
|
<?define CompGUID = 60EF66F9-7721-4EDB-A0DF-F64F5F2F402A?>
|
||||||
|
<?elseif $(var.Language) = en-US?>
|
||||||
|
<?define IdSafeLanguage = en_US?>
|
||||||
|
<?define CompGUID = 3CEF6FD7-348D-40EC-A75F-6351597CC091?>
|
||||||
|
<?elseif $(var.Language) = es-ES?>
|
||||||
|
<?define IdSafeLanguage = es_ES?>
|
||||||
|
<?define CompGUID = E0A3DD93-18DB-4BAA-A343-E33BFA8FB789?>
|
||||||
|
<?elseif $(var.Language) = fr-FR?>
|
||||||
|
<?define IdSafeLanguage = fr_FR?>
|
||||||
|
<?define CompGUID = A09AC847-F3F1-4C1C-A47D-F60B5218B73D?>
|
||||||
|
<?elseif $(var.Language) = hu-HU?>
|
||||||
|
<?define IdSafeLanguage = hu_HU?>
|
||||||
|
<?define CompGUID = B47DF99E-80FE-4F18-80FD-98085BED74D6?>
|
||||||
|
<?elseif $(var.Language) = it-IT?>
|
||||||
|
<?define IdSafeLanguage = it_IT?>
|
||||||
|
<?define CompGUID = 87DE1759-9749-4205-86D3-EE3F21740E8B?>
|
||||||
|
<?elseif $(var.Language) = ja-JP?>
|
||||||
|
<?define IdSafeLanguage = ja_JP?>
|
||||||
|
<?define CompGUID = DACD7B23-A12C-4469-B35A-F95CD6DD2121?>
|
||||||
|
<?elseif $(var.Language) = ko-KR?>
|
||||||
|
<?define IdSafeLanguage = ko_KR?>
|
||||||
|
<?define CompGUID = 40BBFD14-BF0A-49C6-80A0-8EC564F1CB65?>
|
||||||
|
<?elseif $(var.Language) = nl-NL?>
|
||||||
|
<?define IdSafeLanguage = nl_NL?>
|
||||||
|
<?define CompGUID = 6A6BBAF7-8CFB-458C-A20D-2484B4FB9B5A?>
|
||||||
|
<?elseif $(var.Language) = pl-PL?>
|
||||||
|
<?define IdSafeLanguage = pl_PL?>
|
||||||
|
<?define CompGUID = E03CDC2E-3D8A-4B14-BC70-C66B8C46A2EB?>
|
||||||
|
<?elseif $(var.Language) = pt-BR?>
|
||||||
|
<?define IdSafeLanguage = pt_BR?>
|
||||||
|
<?define CompGUID = FFAA45E5-6933-412A-B0A8-97F59E635419?>
|
||||||
|
<?elseif $(var.Language) = pt-PT?>
|
||||||
|
<?define IdSafeLanguage = pt_PT?>
|
||||||
|
<?define CompGUID = 7ECECEE4-095A-437E-AEDC-95FE77C3065E?>
|
||||||
|
<?elseif $(var.Language) = ru-RU?>
|
||||||
|
<?define IdSafeLanguage = ru_RU?>
|
||||||
|
<?define CompGUID = 30752E37-34DF-4359-B317-AE043015C204?>
|
||||||
|
<?elseif $(var.Language) = sv-SE?>
|
||||||
|
<?define IdSafeLanguage = sv_SE?>
|
||||||
|
<?define CompGUID = 61FF96C4-DADC-4CF2-91FA-60DCAF70DE21?>
|
||||||
|
<?elseif $(var.Language) = tr-TR?>
|
||||||
|
<?define IdSafeLanguage = tr_TR?>
|
||||||
|
<?define CompGUID = 821A28CF-DB00-4CD9-AFCF-B14B00014528?>
|
||||||
|
<?elseif $(var.Language) = zh-CN?>
|
||||||
|
<?define IdSafeLanguage = zh_CN?>
|
||||||
|
<?define CompGUID = 79586358-7BDA-46D4-94A6-99DB8F269630?>
|
||||||
|
<?elseif $(var.Language) = zh-TW?>
|
||||||
|
<?define IdSafeLanguage = zh_TW?>
|
||||||
|
<?define CompGUID = E4686F9A-F347-44B3-9244-BB8A9BE92193?>
|
||||||
|
<?else?>
|
||||||
|
<?define IdSafeLanguage = $(var.Language)?>
|
||||||
|
<?define CompGUID = 19C2DCCC-7A75-47D4-9957-2480D388CA5C?>
|
||||||
|
<?endif?>
|
||||||
|
<DirectoryRef Id="SettingsStringsFolder">
|
||||||
|
<Directory Id="Strings$(var.IdSafeLanguage)Settings" Name="$(var.Language)" />
|
||||||
|
</DirectoryRef>
|
||||||
|
<DirectoryRef Id="Strings$(var.IdSafeLanguage)Settings" FileSource="$(var.SettingsV2StringsFilesPath)\$(var.Language)">
|
||||||
|
<Component Id="Strings$(var.IdSafeLanguage)SettingsComp" Win64="yes" Guid="$(var.CompGUID)">
|
||||||
|
<RegistryKey Root="$(var.RegistryScope)" Key="Software\Classes\powertoys\components">
|
||||||
|
<RegistryValue Type="string" Name="Strings$(var.IdSafeLanguage)SettingsComp" Value="" KeyPath="yes"/>
|
||||||
|
</RegistryKey>
|
||||||
|
<File Id="Strings$(var.IdSafeLanguage)SettingsResourceFile" Source="$(var.SettingsV2StringsFilesPath)\$(var.Language)\Resources.resw" />
|
||||||
|
</Component>
|
||||||
|
</DirectoryRef>
|
||||||
|
<?undef IdSafeLanguage?>
|
||||||
|
<?undef CompGUID?>
|
||||||
|
<?endforeach?>
|
||||||
|
|
||||||
<DirectoryRef Id="SettingsV2AssetsInstallFolder" FileSource="$(var.SettingsV2AssetsFilesPath)">
|
<DirectoryRef Id="SettingsV2AssetsInstallFolder" FileSource="$(var.SettingsV2AssetsFilesPath)">
|
||||||
<!-- Generated by generateFileComponents.ps1 -->
|
<!-- Generated by generateFileComponents.ps1 -->
|
||||||
<!--SettingsV2AssetsFiles_Component_Def-->
|
<!--SettingsV2AssetsFiles_Component_Def-->
|
||||||
@@ -47,6 +134,51 @@
|
|||||||
|
|
||||||
<ComponentGroup Id="SettingsComponentGroup">
|
<ComponentGroup Id="SettingsComponentGroup">
|
||||||
|
|
||||||
|
<?foreach Language in $(var.LocLanguageList)?>
|
||||||
|
<!--NB: Ids can't contain hyphens-->
|
||||||
|
<?if $(var.Language) = cs-CZ?>
|
||||||
|
<?define IdSafeLanguage = cs_CZ?>
|
||||||
|
<?elseif $(var.Language) = de-DE?>
|
||||||
|
<?define IdSafeLanguage = de_DE?>
|
||||||
|
<?elseif $(var.Language) = en-US?>
|
||||||
|
<?define IdSafeLanguage = en_US?>
|
||||||
|
<?elseif $(var.Language) = es-ES?>
|
||||||
|
<?define IdSafeLanguage = es_ES?>
|
||||||
|
<?elseif $(var.Language) = fr-FR?>
|
||||||
|
<?define IdSafeLanguage = fr_FR?>
|
||||||
|
<?elseif $(var.Language) = hu-HU?>
|
||||||
|
<?define IdSafeLanguage = hu_HU?>
|
||||||
|
<?elseif $(var.Language) = it-IT?>
|
||||||
|
<?define IdSafeLanguage = it_IT?>
|
||||||
|
<?elseif $(var.Language) = ja-JP?>
|
||||||
|
<?define IdSafeLanguage = ja_JP?>
|
||||||
|
<?elseif $(var.Language) = ko-KR?>
|
||||||
|
<?define IdSafeLanguage = ko_KR?>
|
||||||
|
<?elseif $(var.Language) = nl-NL?>
|
||||||
|
<?define IdSafeLanguage = nl_NL?>
|
||||||
|
<?elseif $(var.Language) = pl-PL?>
|
||||||
|
<?define IdSafeLanguage = pl_PL?>
|
||||||
|
<?elseif $(var.Language) = pt-BR?>
|
||||||
|
<?define IdSafeLanguage = pt_BR?>
|
||||||
|
<?elseif $(var.Language) = pt-PT?>
|
||||||
|
<?define IdSafeLanguage = pt_PT?>
|
||||||
|
<?elseif $(var.Language) = ru-RU?>
|
||||||
|
<?define IdSafeLanguage = ru_RU?>
|
||||||
|
<?elseif $(var.Language) = sv-SE?>
|
||||||
|
<?define IdSafeLanguage = sv_SE?>
|
||||||
|
<?elseif $(var.Language) = tr-TR?>
|
||||||
|
<?define IdSafeLanguage = tr_TR?>
|
||||||
|
<?elseif $(var.Language) = zh-CN?>
|
||||||
|
<?define IdSafeLanguage = zh_CN?>
|
||||||
|
<?elseif $(var.Language) = zh-TW?>
|
||||||
|
<?define IdSafeLanguage = zh_TW?>
|
||||||
|
<?else?>
|
||||||
|
<?define IdSafeLanguage = $(var.Language)?>
|
||||||
|
<?endif?>
|
||||||
|
<ComponentRef Id="Strings$(var.IdSafeLanguage)SettingsComp" />
|
||||||
|
<?undef IdSafeLanguage?>
|
||||||
|
<?endforeach?>
|
||||||
|
|
||||||
<Component Id="RemoveSettingsFolder" Guid="2D3AEF68-4E5A-4FF9-A5C0-9E53391AC754" Directory="SettingsV2AssetsInstallFolder" >
|
<Component Id="RemoveSettingsFolder" Guid="2D3AEF68-4E5A-4FF9-A5C0-9E53391AC754" Directory="SettingsV2AssetsInstallFolder" >
|
||||||
<RegistryKey Root="$(var.RegistryScope)" Key="Software\Classes\powertoys\components">
|
<RegistryKey Root="$(var.RegistryScope)" Key="Software\Classes\powertoys\components">
|
||||||
<RegistryValue Type="string" Name="RemoveSettingsFolder" Value="" KeyPath="yes"/>
|
<RegistryValue Type="string" Name="RemoveSettingsFolder" Value="" KeyPath="yes"/>
|
||||||
@@ -55,6 +187,51 @@
|
|||||||
<RemoveFolder Id="RemoveFolderSettingsV2OOBEAssetsFluentIconsInstallFolder" Directory="SettingsV2OOBEAssetsFluentIconsInstallFolder" On="uninstall"/>
|
<RemoveFolder Id="RemoveFolderSettingsV2OOBEAssetsFluentIconsInstallFolder" Directory="SettingsV2OOBEAssetsFluentIconsInstallFolder" On="uninstall"/>
|
||||||
<RemoveFolder Id="RemoveFolderSettingsV2AssetsModulesInstallFolder" Directory="SettingsV2AssetsModulesInstallFolder" On="uninstall"/>
|
<RemoveFolder Id="RemoveFolderSettingsV2AssetsModulesInstallFolder" Directory="SettingsV2AssetsModulesInstallFolder" On="uninstall"/>
|
||||||
<RemoveFolder Id="RemoveFolderSettingsV2OOBEAssetsModulesInstallFolder" Directory="SettingsV2OOBEAssetsModulesInstallFolder" On="uninstall"/>
|
<RemoveFolder Id="RemoveFolderSettingsV2OOBEAssetsModulesInstallFolder" Directory="SettingsV2OOBEAssetsModulesInstallFolder" On="uninstall"/>
|
||||||
|
<RemoveFolder Id="RemoveFolderSettingsStringsFolder" Directory="SettingsStringsFolder" On="uninstall"/>
|
||||||
|
<?foreach Language in $(var.LocLanguageList)?>
|
||||||
|
<!--NB: Ids can't contain hyphens-->
|
||||||
|
<?if $(var.Language) = cs-CZ?>
|
||||||
|
<?define IdSafeLanguage = cs_CZ?>
|
||||||
|
<?elseif $(var.Language) = de-DE?>
|
||||||
|
<?define IdSafeLanguage = de_DE?>
|
||||||
|
<?elseif $(var.Language) = en-US?>
|
||||||
|
<?define IdSafeLanguage = en_US?>
|
||||||
|
<?elseif $(var.Language) = es-ES?>
|
||||||
|
<?define IdSafeLanguage = es_ES?>
|
||||||
|
<?elseif $(var.Language) = fr-FR?>
|
||||||
|
<?define IdSafeLanguage = fr_FR?>
|
||||||
|
<?elseif $(var.Language) = hu-HU?>
|
||||||
|
<?define IdSafeLanguage = hu_HU?>
|
||||||
|
<?elseif $(var.Language) = it-IT?>
|
||||||
|
<?define IdSafeLanguage = it_IT?>
|
||||||
|
<?elseif $(var.Language) = ja-JP?>
|
||||||
|
<?define IdSafeLanguage = ja_JP?>
|
||||||
|
<?elseif $(var.Language) = ko-KR?>
|
||||||
|
<?define IdSafeLanguage = ko_KR?>
|
||||||
|
<?elseif $(var.Language) = nl-NL?>
|
||||||
|
<?define IdSafeLanguage = nl_NL?>
|
||||||
|
<?elseif $(var.Language) = pl-PL?>
|
||||||
|
<?define IdSafeLanguage = pl_PL?>
|
||||||
|
<?elseif $(var.Language) = pt-BR?>
|
||||||
|
<?define IdSafeLanguage = pt_BR?>
|
||||||
|
<?elseif $(var.Language) = pt-PT?>
|
||||||
|
<?define IdSafeLanguage = pt_PT?>
|
||||||
|
<?elseif $(var.Language) = ru-RU?>
|
||||||
|
<?define IdSafeLanguage = ru_RU?>
|
||||||
|
<?elseif $(var.Language) = sv-SE?>
|
||||||
|
<?define IdSafeLanguage = sv_SE?>
|
||||||
|
<?elseif $(var.Language) = tr-TR?>
|
||||||
|
<?define IdSafeLanguage = tr_TR?>
|
||||||
|
<?elseif $(var.Language) = zh-CN?>
|
||||||
|
<?define IdSafeLanguage = zh_CN?>
|
||||||
|
<?elseif $(var.Language) = zh-TW?>
|
||||||
|
<?define IdSafeLanguage = zh_TW?>
|
||||||
|
<?else?>
|
||||||
|
<?define IdSafeLanguage = $(var.Language)?>
|
||||||
|
<?endif?>
|
||||||
|
<RemoveFolder Id="RemoveFolderStrings$(var.IdSafeLanguage)Settings" Directory="Strings$(var.IdSafeLanguage)Settings" On="uninstall"/>
|
||||||
|
<?undef IdSafeLanguage?>
|
||||||
|
<?endforeach?>
|
||||||
</Component>
|
</Component>
|
||||||
</ComponentGroup>
|
</ComponentGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
// See the LICENSE file in the project root for more information.
|
// See the LICENSE file in the project root for more information.
|
||||||
|
|
||||||
using System.ComponentModel.Composition;
|
using System.ComponentModel.Composition;
|
||||||
|
using System.Globalization;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Interop;
|
using System.Windows.Interop;
|
||||||
using ColorPicker.ViewModelContracts;
|
using ColorPicker.ViewModelContracts;
|
||||||
@@ -17,7 +18,21 @@ namespace ColorPicker
|
|||||||
public MainWindow()
|
public MainWindow()
|
||||||
{
|
{
|
||||||
Closing += MainWindow_Closing;
|
Closing += MainWindow_Closing;
|
||||||
|
|
||||||
Bootstrapper.InitializeContainer(this);
|
Bootstrapper.InitializeContainer(this);
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(MainViewModel.LanguageTag))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
ColorPicker.Properties.Resources.Culture = new System.Globalization.CultureInfo(MainViewModel.LanguageTag);
|
||||||
|
}
|
||||||
|
catch (CultureNotFoundException)
|
||||||
|
{
|
||||||
|
// Add logging here
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
DataContext = this;
|
DataContext = this;
|
||||||
Show(); // Call show just to make sure source is initialized at startup.
|
Show(); // Call show just to make sure source is initialized at startup.
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ namespace ColorPicker.Settings
|
|||||||
|
|
||||||
SettingItem<bool> ShowColorName { get; }
|
SettingItem<bool> ShowColorName { get; }
|
||||||
|
|
||||||
|
SettingItem<string> LanguageTag { get; }
|
||||||
|
|
||||||
void SendSettingsTelemetry();
|
void SendSettingsTelemetry();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ using System.IO;
|
|||||||
using System.IO.Abstractions;
|
using System.IO.Abstractions;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
using System.Windows;
|
||||||
using ColorPicker.Common;
|
using ColorPicker.Common;
|
||||||
using ManagedCommon;
|
using ManagedCommon;
|
||||||
using Microsoft.PowerToys.Settings.UI.Library;
|
using Microsoft.PowerToys.Settings.UI.Library;
|
||||||
@@ -25,6 +26,7 @@ namespace ColorPicker.Settings
|
|||||||
private readonly ISettingsUtils _settingsUtils;
|
private readonly ISettingsUtils _settingsUtils;
|
||||||
private const string ColorPickerModuleName = "ColorPicker";
|
private const string ColorPickerModuleName = "ColorPicker";
|
||||||
private const string ColorPickerHistoryFilename = "colorHistory.json";
|
private const string ColorPickerHistoryFilename = "colorHistory.json";
|
||||||
|
private const string LanguageFilename = "language.json";
|
||||||
private const string DefaultActivationShortcut = "Ctrl + Break";
|
private const string DefaultActivationShortcut = "Ctrl + Break";
|
||||||
private const int MaxNumberOfRetry = 5;
|
private const int MaxNumberOfRetry = 5;
|
||||||
private const int SettingsReadOnChangeDelayInMs = 300;
|
private const int SettingsReadOnChangeDelayInMs = 300;
|
||||||
@@ -47,8 +49,10 @@ namespace ColorPicker.Settings
|
|||||||
ColorHistoryLimit = new SettingItem<int>(20);
|
ColorHistoryLimit = new SettingItem<int>(20);
|
||||||
ColorHistory.CollectionChanged += ColorHistory_CollectionChanged;
|
ColorHistory.CollectionChanged += ColorHistory_CollectionChanged;
|
||||||
ShowColorName = new SettingItem<bool>(false);
|
ShowColorName = new SettingItem<bool>(false);
|
||||||
|
LanguageTag = new SettingItem<string>(string.Empty);
|
||||||
|
|
||||||
LoadSettingsFromJson();
|
LoadSettingsFromJson();
|
||||||
|
LoadLanguage();
|
||||||
|
|
||||||
// delay loading settings on change by some time to avoid file in use exception
|
// delay loading settings on change by some time to avoid file in use exception
|
||||||
_watcher = Helper.GetFileWatcher(ColorPickerModuleName, "settings.json", () => throttledActionInvoker.ScheduleAction(LoadSettingsFromJson, SettingsReadOnChangeDelayInMs));
|
_watcher = Helper.GetFileWatcher(ColorPickerModuleName, "settings.json", () => throttledActionInvoker.ScheduleAction(LoadSettingsFromJson, SettingsReadOnChangeDelayInMs));
|
||||||
@@ -80,6 +84,22 @@ namespace ColorPicker.Settings
|
|||||||
|
|
||||||
public SettingItem<bool> ShowColorName { get; }
|
public SettingItem<bool> ShowColorName { get; }
|
||||||
|
|
||||||
|
public SettingItem<string> LanguageTag { get; private set; }
|
||||||
|
|
||||||
|
private void LoadLanguage()
|
||||||
|
{
|
||||||
|
string filePath = _settingsUtils.GetSettingsFilePath(string.Empty, LanguageFilename);
|
||||||
|
if (!File.Exists(filePath))
|
||||||
|
{
|
||||||
|
LanguageTag.Value = string.Empty;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string jsonSettingsString = System.IO.File.ReadAllText(filePath);
|
||||||
|
LanguageTag.Value = JsonSerializer.Deserialize<OutGoingLanguageSettings>(jsonSettingsString).LanguageTag;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void LoadSettingsFromJson()
|
private void LoadSettingsFromJson()
|
||||||
{
|
{
|
||||||
// TODO this IO call should by Async, update GetFileWatcher helper to support async
|
// TODO this IO call should by Async, update GetFileWatcher helper to support async
|
||||||
|
|||||||
@@ -28,6 +28,11 @@ namespace ColorPicker.ViewModelContracts
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
bool ShowColorName { get; }
|
bool ShowColorName { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a value indicating the language of the app
|
||||||
|
/// </summary>
|
||||||
|
string LanguageTag { get; }
|
||||||
|
|
||||||
void RegisterWindowHandle(System.Windows.Interop.HwndSource hwndSource);
|
void RegisterWindowHandle(System.Windows.Interop.HwndSource hwndSource);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,6 +41,11 @@ namespace ColorPicker.ViewModels
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private string _colorName;
|
private string _colorName;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Backing field for <see cref="LanguageTag"/>
|
||||||
|
/// </summary>
|
||||||
|
private string _languageTag;
|
||||||
|
|
||||||
[ImportingConstructor]
|
[ImportingConstructor]
|
||||||
public MainViewModel(
|
public MainViewModel(
|
||||||
IMouseInfoProvider mouseInfoProvider,
|
IMouseInfoProvider mouseInfoProvider,
|
||||||
@@ -76,6 +81,8 @@ namespace ColorPicker.ViewModels
|
|||||||
|
|
||||||
_userSettings.ShowColorName.PropertyChanged += (s, e) => { OnPropertyChanged(nameof(ShowColorName)); };
|
_userSettings.ShowColorName.PropertyChanged += (s, e) => { OnPropertyChanged(nameof(ShowColorName)); };
|
||||||
|
|
||||||
|
LanguageTag = _userSettings.LanguageTag.Value;
|
||||||
|
|
||||||
// Only start a local keyboard low level hook if running as a standalone.
|
// Only start a local keyboard low level hook if running as a standalone.
|
||||||
// Otherwise, the global keyboard hook from runner will be used to activate Color Picker through ShowColorPickerSharedEvent
|
// Otherwise, the global keyboard hook from runner will be used to activate Color Picker through ShowColorPickerSharedEvent
|
||||||
// and the Escape key will be registered as a shortcut by appStateHandler when ColorPicker is being used.
|
// and the Escape key will be registered as a shortcut by appStateHandler when ColorPicker is being used.
|
||||||
@@ -122,6 +129,15 @@ namespace ColorPicker.ViewModels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string LanguageTag
|
||||||
|
{
|
||||||
|
get => _languageTag;
|
||||||
|
private set
|
||||||
|
{
|
||||||
|
_languageTag = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public bool ShowColorName
|
public bool ShowColorName
|
||||||
{
|
{
|
||||||
get => _userSettings.ShowColorName.Value;
|
get => _userSettings.ShowColorName.Value;
|
||||||
|
|||||||
@@ -69,6 +69,7 @@
|
|||||||
<ProjectReference Include="..\..\..\..\common\interop\PowerToys.Interop.vcxproj" />
|
<ProjectReference Include="..\..\..\..\common\interop\PowerToys.Interop.vcxproj" />
|
||||||
<ProjectReference Include="..\..\..\..\common\ManagedCommon\ManagedCommon.csproj" />
|
<ProjectReference Include="..\..\..\..\common\ManagedCommon\ManagedCommon.csproj" />
|
||||||
<ProjectReference Include="..\..\..\..\common\Common.UI\Common.UI.csproj" />
|
<ProjectReference Include="..\..\..\..\common\Common.UI\Common.UI.csproj" />
|
||||||
|
<ProjectReference Include="..\..\..\..\settings-ui\Settings.UI.Library\Settings.UI.Library.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Update="Properties\Resources.Designer.cs">
|
<Compile Update="Properties\Resources.Designer.cs">
|
||||||
|
|||||||
@@ -42,6 +42,20 @@ namespace FancyZonesEditor
|
|||||||
|
|
||||||
public MainWindow(bool spanZonesAcrossMonitors, Rect workArea)
|
public MainWindow(bool spanZonesAcrossMonitors, Rect workArea)
|
||||||
{
|
{
|
||||||
|
var languageTag = App.FancyZonesEditorIO.LoadLanguage();
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(languageTag))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
FancyZonesEditor.Properties.Resources.Culture = new System.Globalization.CultureInfo(languageTag);
|
||||||
|
}
|
||||||
|
catch (CultureNotFoundException ex)
|
||||||
|
{
|
||||||
|
Logger.LogError("CultureNotFoundException: " + ex.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
_createLayoutAnnounce = (TextBlock)FindName("LayoutCreationAnnounce");
|
_createLayoutAnnounce = (TextBlock)FindName("LayoutCreationAnnounce");
|
||||||
DataContext = _settings;
|
DataContext = _settings;
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ using System.Threading.Tasks;
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
using FancyZonesEditor.Models;
|
using FancyZonesEditor.Models;
|
||||||
using ManagedCommon;
|
using ManagedCommon;
|
||||||
|
using Microsoft.PowerToys.Settings.UI.Library;
|
||||||
|
|
||||||
namespace FancyZonesEditor.Utils
|
namespace FancyZonesEditor.Utils
|
||||||
{
|
{
|
||||||
@@ -37,6 +38,7 @@ namespace FancyZonesEditor.Utils
|
|||||||
private const string CustomLayoutsFile = "\\Microsoft\\PowerToys\\FancyZones\\custom-layouts.json";
|
private const string CustomLayoutsFile = "\\Microsoft\\PowerToys\\FancyZones\\custom-layouts.json";
|
||||||
private const string DefaultLayoutsFile = "\\Microsoft\\PowerToys\\FancyZones\\default-layouts.json";
|
private const string DefaultLayoutsFile = "\\Microsoft\\PowerToys\\FancyZones\\default-layouts.json";
|
||||||
private const string ParamsFile = "\\Microsoft\\PowerToys\\FancyZones\\editor-parameters.json";
|
private const string ParamsFile = "\\Microsoft\\PowerToys\\FancyZones\\editor-parameters.json";
|
||||||
|
private const string LanguageFile = "\\Microsoft\\PowerToys\\language.json";
|
||||||
|
|
||||||
// Non-localizable string: default virtual desktop id
|
// Non-localizable string: default virtual desktop id
|
||||||
private const string DefaultVirtualDesktopGuid = "{00000000-0000-0000-0000-000000000000}";
|
private const string DefaultVirtualDesktopGuid = "{00000000-0000-0000-0000-000000000000}";
|
||||||
@@ -63,6 +65,8 @@ namespace FancyZonesEditor.Utils
|
|||||||
|
|
||||||
public string FancyZonesEditorParamsFile { get; private set; }
|
public string FancyZonesEditorParamsFile { get; private set; }
|
||||||
|
|
||||||
|
public string GlobalLanguageFile { get; private set; }
|
||||||
|
|
||||||
private enum CmdArgs
|
private enum CmdArgs
|
||||||
{
|
{
|
||||||
PowerToysPID = 0,
|
PowerToysPID = 0,
|
||||||
@@ -332,6 +336,31 @@ namespace FancyZonesEditor.Utils
|
|||||||
FancyZonesCustomLayoutsFile = localAppDataDir + CustomLayoutsFile;
|
FancyZonesCustomLayoutsFile = localAppDataDir + CustomLayoutsFile;
|
||||||
FancyZonesDefaultLayoutsFile = localAppDataDir + DefaultLayoutsFile;
|
FancyZonesDefaultLayoutsFile = localAppDataDir + DefaultLayoutsFile;
|
||||||
FancyZonesEditorParamsFile = localAppDataDir + ParamsFile;
|
FancyZonesEditorParamsFile = localAppDataDir + ParamsFile;
|
||||||
|
GlobalLanguageFile = localAppDataDir + LanguageFile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public string LoadLanguage()
|
||||||
|
{
|
||||||
|
string ret = string.Empty;
|
||||||
|
|
||||||
|
if (!File.Exists(GlobalLanguageFile))
|
||||||
|
{
|
||||||
|
return string.Empty;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
string jsonSettingsString = System.IO.File.ReadAllText(GlobalLanguageFile);
|
||||||
|
ret = JsonSerializer.Deserialize<OutGoingLanguageSettings>(jsonSettingsString).LanguageTag;
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
return string.Empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ParsingResult ParseParams()
|
public ParsingResult ParseParams()
|
||||||
|
|||||||
@@ -521,9 +521,9 @@ namespace ImageResizer.Models
|
|||||||
Assert.IsTrue(File.Exists(_directory + @"\nul_.png"));
|
Assert.IsTrue(File.Exists(_directory + @"\nul_.png"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Settings Settings(Action<Settings> action = null)
|
private static ImageResizerSettings Settings(Action<ImageResizerSettings> action = null)
|
||||||
{
|
{
|
||||||
var settings = new Settings()
|
var settings = new ImageResizerSettings()
|
||||||
{
|
{
|
||||||
SelectedSizeIndex = 0,
|
SelectedSizeIndex = 0,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -21,20 +21,20 @@ namespace ImageResizer.Properties
|
|||||||
public SettingsTests()
|
public SettingsTests()
|
||||||
{
|
{
|
||||||
// Change settings.json path to a temp file
|
// Change settings.json path to a temp file
|
||||||
Settings.SettingsPath = ".\\test_settings.json";
|
ImageResizerSettings.SettingsPath = ".\\test_settings.json";
|
||||||
}
|
}
|
||||||
|
|
||||||
[ClassInitialize]
|
[ClassInitialize]
|
||||||
public static void ClassInitialize(TestContext context)
|
public static void ClassInitialize(TestContext context)
|
||||||
{
|
{
|
||||||
// new App() needs to be created since Settings.Reload() uses App.Current to update properties on the UI thread. App() can be created only once otherwise it results in System.InvalidOperationException : Cannot create more than one System.Windows.Application instance in the same AppDomain.
|
// new App() needs to be created since ImageResizerSettings.Reload() uses App.Current to update properties on the UI thread. App() can be created only once otherwise it results in System.InvalidOperationException : Cannot create more than one System.Windows.Application instance in the same AppDomain.
|
||||||
_imageResizerApp = new App();
|
_imageResizerApp = new App();
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void AllSizesPropagatesSizesCollectionEvents()
|
public void AllSizesPropagatesSizesCollectionEvents()
|
||||||
{
|
{
|
||||||
var settings = new Settings
|
var settings = new ImageResizerSettings
|
||||||
{
|
{
|
||||||
CustomSize = new CustomSize(),
|
CustomSize = new CustomSize(),
|
||||||
};
|
};
|
||||||
@@ -53,7 +53,7 @@ namespace ImageResizer.Properties
|
|||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void AllSizesPropagatesSizesPropertyEvents()
|
public void AllSizesPropagatesSizesPropertyEvents()
|
||||||
{
|
{
|
||||||
var settings = new Settings
|
var settings = new ImageResizerSettings
|
||||||
{
|
{
|
||||||
CustomSize = new CustomSize(),
|
CustomSize = new CustomSize(),
|
||||||
};
|
};
|
||||||
@@ -77,7 +77,7 @@ namespace ImageResizer.Properties
|
|||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void AllSizesContainsSizes()
|
public void AllSizesContainsSizes()
|
||||||
{
|
{
|
||||||
var settings = new Settings
|
var settings = new ImageResizerSettings
|
||||||
{
|
{
|
||||||
CustomSize = new CustomSize(),
|
CustomSize = new CustomSize(),
|
||||||
};
|
};
|
||||||
@@ -89,7 +89,7 @@ namespace ImageResizer.Properties
|
|||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void AllSizesContainsCustomSize()
|
public void AllSizesContainsCustomSize()
|
||||||
{
|
{
|
||||||
var settings = new Settings
|
var settings = new ImageResizerSettings
|
||||||
{
|
{
|
||||||
CustomSize = new CustomSize(),
|
CustomSize = new CustomSize(),
|
||||||
};
|
};
|
||||||
@@ -102,7 +102,7 @@ namespace ImageResizer.Properties
|
|||||||
public void AllSizesHandlesPropertyEventsForCustomSize()
|
public void AllSizesHandlesPropertyEventsForCustomSize()
|
||||||
{
|
{
|
||||||
var originalCustomSize = new CustomSize();
|
var originalCustomSize = new CustomSize();
|
||||||
var settings = new Settings
|
var settings = new ImageResizerSettings
|
||||||
{
|
{
|
||||||
CustomSize = originalCustomSize,
|
CustomSize = originalCustomSize,
|
||||||
};
|
};
|
||||||
@@ -127,7 +127,7 @@ namespace ImageResizer.Properties
|
|||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void FileNameFormatWorks()
|
public void FileNameFormatWorks()
|
||||||
{
|
{
|
||||||
var settings = new Settings { FileName = "{T}%1e%2s%3t%4%5%6%7" };
|
var settings = new ImageResizerSettings { FileName = "{T}%1e%2s%3t%4%5%6%7" };
|
||||||
|
|
||||||
var result = settings.FileNameFormat;
|
var result = settings.FileNameFormat;
|
||||||
|
|
||||||
@@ -140,7 +140,7 @@ namespace ImageResizer.Properties
|
|||||||
[DataRow(2)]
|
[DataRow(2)]
|
||||||
public void SelectedSizeReturnsCustomSizeWhenOutOfRange(int index)
|
public void SelectedSizeReturnsCustomSizeWhenOutOfRange(int index)
|
||||||
{
|
{
|
||||||
var settings = new Settings
|
var settings = new ImageResizerSettings
|
||||||
{
|
{
|
||||||
SelectedSizeIndex = index,
|
SelectedSizeIndex = index,
|
||||||
CustomSize = new CustomSize(),
|
CustomSize = new CustomSize(),
|
||||||
@@ -155,7 +155,7 @@ namespace ImageResizer.Properties
|
|||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void SelectedSizeReturnsSizeWhenInRange()
|
public void SelectedSizeReturnsSizeWhenInRange()
|
||||||
{
|
{
|
||||||
var settings = new Settings
|
var settings = new ImageResizerSettings
|
||||||
{
|
{
|
||||||
SelectedSizeIndex = 0,
|
SelectedSizeIndex = 0,
|
||||||
};
|
};
|
||||||
@@ -169,7 +169,7 @@ namespace ImageResizer.Properties
|
|||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void IDataErrorInfoErrorReturnsEmpty()
|
public void IDataErrorInfoErrorReturnsEmpty()
|
||||||
{
|
{
|
||||||
var settings = new Settings();
|
var settings = new ImageResizerSettings();
|
||||||
|
|
||||||
var result = ((IDataErrorInfo)settings).Error;
|
var result = ((IDataErrorInfo)settings).Error;
|
||||||
|
|
||||||
@@ -181,7 +181,7 @@ namespace ImageResizer.Properties
|
|||||||
[DataRow(101)]
|
[DataRow(101)]
|
||||||
public void IDataErrorInfoItemJpegQualityLevelReturnsErrorWhenOutOfRange(int value)
|
public void IDataErrorInfoItemJpegQualityLevelReturnsErrorWhenOutOfRange(int value)
|
||||||
{
|
{
|
||||||
var settings = new Settings { JpegQualityLevel = value };
|
var settings = new ImageResizerSettings { JpegQualityLevel = value };
|
||||||
|
|
||||||
var result = ((IDataErrorInfo)settings)["JpegQualityLevel"];
|
var result = ((IDataErrorInfo)settings)["JpegQualityLevel"];
|
||||||
|
|
||||||
@@ -196,7 +196,7 @@ namespace ImageResizer.Properties
|
|||||||
[DataRow(100)]
|
[DataRow(100)]
|
||||||
public void IDataErrorInfoItemJpegQualityLevelReturnsEmptyWhenInRange(int value)
|
public void IDataErrorInfoItemJpegQualityLevelReturnsEmptyWhenInRange(int value)
|
||||||
{
|
{
|
||||||
var settings = new Settings { JpegQualityLevel = value };
|
var settings = new ImageResizerSettings { JpegQualityLevel = value };
|
||||||
|
|
||||||
var result = ((IDataErrorInfo)settings)["JpegQualityLevel"];
|
var result = ((IDataErrorInfo)settings)["JpegQualityLevel"];
|
||||||
|
|
||||||
@@ -206,7 +206,7 @@ namespace ImageResizer.Properties
|
|||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void IDataErrorInfoItemReturnsEmptyWhenNotJpegQualityLevel()
|
public void IDataErrorInfoItemReturnsEmptyWhenNotJpegQualityLevel()
|
||||||
{
|
{
|
||||||
var settings = new Settings();
|
var settings = new ImageResizerSettings();
|
||||||
|
|
||||||
var result = ((IDataErrorInfo)settings)["Unknown"];
|
var result = ((IDataErrorInfo)settings)["Unknown"];
|
||||||
|
|
||||||
@@ -217,56 +217,56 @@ namespace ImageResizer.Properties
|
|||||||
public void ReloadCreatesFileWhenFileNotFound()
|
public void ReloadCreatesFileWhenFileNotFound()
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
var settings = new Settings();
|
var settings = new ImageResizerSettings();
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
Assert.IsFalse(System.IO.File.Exists(Settings.SettingsPath));
|
Assert.IsFalse(System.IO.File.Exists(ImageResizerSettings.SettingsPath));
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
settings.Reload();
|
settings.Reload();
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
Assert.IsTrue(System.IO.File.Exists(Settings.SettingsPath));
|
Assert.IsTrue(System.IO.File.Exists(ImageResizerSettings.SettingsPath));
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void SaveCreatesFile()
|
public void SaveCreatesFile()
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
var settings = new Settings();
|
var settings = new ImageResizerSettings();
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
Assert.IsFalse(System.IO.File.Exists(Settings.SettingsPath));
|
Assert.IsFalse(System.IO.File.Exists(ImageResizerSettings.SettingsPath));
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
settings.Save();
|
settings.Save();
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
Assert.IsTrue(System.IO.File.Exists(Settings.SettingsPath));
|
Assert.IsTrue(System.IO.File.Exists(ImageResizerSettings.SettingsPath));
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void SaveJsonIsReadableByReload()
|
public void SaveJsonIsReadableByReload()
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
var settings = new Settings();
|
var settings = new ImageResizerSettings();
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
Assert.IsFalse(System.IO.File.Exists(Settings.SettingsPath));
|
Assert.IsFalse(System.IO.File.Exists(ImageResizerSettings.SettingsPath));
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
settings.Save();
|
settings.Save();
|
||||||
settings.Reload(); // If the JSON file created by Save() is not readable this function will throw an error
|
settings.Reload(); // If the JSON file created by Save() is not readable this function will throw an error
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
Assert.IsTrue(System.IO.File.Exists(Settings.SettingsPath));
|
Assert.IsTrue(System.IO.File.Exists(ImageResizerSettings.SettingsPath));
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void ReloadRaisesPropertyChanged()
|
public void ReloadRaisesPropertyChanged()
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
var settings = new Settings();
|
var settings = new ImageResizerSettings();
|
||||||
settings.Save(); // To create the settings file
|
settings.Save(); // To create the settings file
|
||||||
|
|
||||||
var shrinkOnlyChanged = false;
|
var shrinkOnlyChanged = false;
|
||||||
@@ -349,7 +349,7 @@ namespace ImageResizer.Properties
|
|||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void SystemTextJsonDeserializesCorrectly()
|
public void SystemTextJsonDeserializesCorrectly()
|
||||||
{
|
{
|
||||||
// Generated Settings file in 0.72
|
// Generated ImageResizerSettings file in 0.72
|
||||||
var defaultInput =
|
var defaultInput =
|
||||||
"{\r\n \"properties\": {\r\n \"imageresizer_selectedSizeIndex\": {\r\n \"value\": 1\r\n },\r\n \"imageresizer_shrinkOnly\": {\r\n \"value\": true\r\n },\r\n \"imageresizer_replace\": {\r\n \"value\": true\r\n },\r\n \"imageresizer_ignoreOrientation\": {\r\n \"value\": false\r\n },\r\n \"imageresizer_jpegQualityLevel\": {\r\n \"value\": 91\r\n },\r\n \"imageresizer_pngInterlaceOption\": {\r\n \"value\": 1\r\n },\r\n \"imageresizer_tiffCompressOption\": {\r\n \"value\": 1\r\n },\r\n \"imageresizer_fileName\": {\r\n \"value\": \"%1 %1 (%2)\"\r\n },\r\n \"imageresizer_sizes\": {\r\n \"value\": [\r\n {\r\n \"Id\": 0,\r\n \"ExtraBoxOpacity\": 100,\r\n \"EnableEtraBoxes\": true,\r\n \"name\": \"Small-NotDefault\",\r\n \"fit\": 1,\r\n \"width\": 854,\r\n \"height\": 480,\r\n \"unit\": 3\r\n },\r\n {\r\n \"Id\": 3,\r\n \"ExtraBoxOpacity\": 100,\r\n \"EnableEtraBoxes\": true,\r\n \"name\": \"Phone\",\r\n \"fit\": 1,\r\n \"width\": 320,\r\n \"height\": 568,\r\n \"unit\": 3\r\n }\r\n ]\r\n },\r\n \"imageresizer_keepDateModified\": {\r\n \"value\": false\r\n },\r\n \"imageresizer_fallbackEncoder\": {\r\n \"value\": \"19e4a5aa-5662-4fc5-a0c0-1758028e1057\"\r\n },\r\n \"imageresizer_customSize\": {\r\n \"value\": {\r\n \"Id\": 4,\r\n \"ExtraBoxOpacity\": 100,\r\n \"EnableEtraBoxes\": true,\r\n \"name\": \"custom\",\r\n \"fit\": 1,\r\n \"width\": 1024,\r\n \"height\": 640,\r\n \"unit\": 3\r\n }\r\n }\r\n },\r\n \"name\": \"Image Resizer\",\r\n \"version\": \"1\"\r\n}";
|
"{\r\n \"properties\": {\r\n \"imageresizer_selectedSizeIndex\": {\r\n \"value\": 1\r\n },\r\n \"imageresizer_shrinkOnly\": {\r\n \"value\": true\r\n },\r\n \"imageresizer_replace\": {\r\n \"value\": true\r\n },\r\n \"imageresizer_ignoreOrientation\": {\r\n \"value\": false\r\n },\r\n \"imageresizer_jpegQualityLevel\": {\r\n \"value\": 91\r\n },\r\n \"imageresizer_pngInterlaceOption\": {\r\n \"value\": 1\r\n },\r\n \"imageresizer_tiffCompressOption\": {\r\n \"value\": 1\r\n },\r\n \"imageresizer_fileName\": {\r\n \"value\": \"%1 %1 (%2)\"\r\n },\r\n \"imageresizer_sizes\": {\r\n \"value\": [\r\n {\r\n \"Id\": 0,\r\n \"ExtraBoxOpacity\": 100,\r\n \"EnableEtraBoxes\": true,\r\n \"name\": \"Small-NotDefault\",\r\n \"fit\": 1,\r\n \"width\": 854,\r\n \"height\": 480,\r\n \"unit\": 3\r\n },\r\n {\r\n \"Id\": 3,\r\n \"ExtraBoxOpacity\": 100,\r\n \"EnableEtraBoxes\": true,\r\n \"name\": \"Phone\",\r\n \"fit\": 1,\r\n \"width\": 320,\r\n \"height\": 568,\r\n \"unit\": 3\r\n }\r\n ]\r\n },\r\n \"imageresizer_keepDateModified\": {\r\n \"value\": false\r\n },\r\n \"imageresizer_fallbackEncoder\": {\r\n \"value\": \"19e4a5aa-5662-4fc5-a0c0-1758028e1057\"\r\n },\r\n \"imageresizer_customSize\": {\r\n \"value\": {\r\n \"Id\": 4,\r\n \"ExtraBoxOpacity\": 100,\r\n \"EnableEtraBoxes\": true,\r\n \"name\": \"custom\",\r\n \"fit\": 1,\r\n \"width\": 1024,\r\n \"height\": 640,\r\n \"unit\": 3\r\n }\r\n }\r\n },\r\n \"name\": \"Image Resizer\",\r\n \"version\": \"1\"\r\n}";
|
||||||
|
|
||||||
@@ -384,9 +384,9 @@ namespace ImageResizer.Properties
|
|||||||
[TestCleanup]
|
[TestCleanup]
|
||||||
public void TestCleanUp()
|
public void TestCleanUp()
|
||||||
{
|
{
|
||||||
if (System.IO.File.Exists(Settings.SettingsPath))
|
if (System.IO.File.Exists(ImageResizerSettings.SettingsPath))
|
||||||
{
|
{
|
||||||
System.IO.File.Delete(Settings.SettingsPath);
|
System.IO.File.Delete(ImageResizerSettings.SettingsPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ namespace ImageResizer
|
|||||||
var batch = ResizeBatch.FromCommandLine(Console.In, e?.Args);
|
var batch = ResizeBatch.FromCommandLine(Console.In, e?.Args);
|
||||||
|
|
||||||
// TODO: Add command-line parameters that can be used in lieu of the input page (issue #14)
|
// TODO: Add command-line parameters that can be used in lieu of the input page (issue #14)
|
||||||
var mainWindow = new MainWindow(new MainViewModel(batch, Settings.Default));
|
var mainWindow = new MainWindow(new MainViewModel(batch, ImageResizerSettings.Default));
|
||||||
mainWindow.Show();
|
mainWindow.Show();
|
||||||
|
|
||||||
// Temporary workaround for issue #1273
|
// Temporary workaround for issue #1273
|
||||||
|
|||||||
@@ -63,6 +63,7 @@
|
|||||||
<ProjectReference Include="..\..\..\common\GPOWrapperProjection\GPOWrapperProjection.csproj" />
|
<ProjectReference Include="..\..\..\common\GPOWrapperProjection\GPOWrapperProjection.csproj" />
|
||||||
<ProjectReference Include="..\..\..\common\interop\PowerToys.Interop.vcxproj" />
|
<ProjectReference Include="..\..\..\common\interop\PowerToys.Interop.vcxproj" />
|
||||||
<ProjectReference Include="..\..\..\common\Common.UI\Common.UI.csproj" />
|
<ProjectReference Include="..\..\..\common\Common.UI\Common.UI.csproj" />
|
||||||
|
<ProjectReference Include="..\..\..\settings-ui\Settings.UI.Library\Settings.UI.Library.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Update="Properties\Resources.Designer.cs">
|
<Compile Update="Properties\Resources.Designer.cs">
|
||||||
|
|||||||
@@ -116,6 +116,6 @@ namespace ImageResizer.Models
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void Execute(string file)
|
protected virtual void Execute(string file)
|
||||||
=> new ResizeOperation(file, DestinationDirectory, Settings.Default).Execute();
|
=> new ResizeOperation(file, DestinationDirectory, ImageResizerSettings.Default).Execute();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ namespace ImageResizer.Models
|
|||||||
|
|
||||||
private readonly string _file;
|
private readonly string _file;
|
||||||
private readonly string _destinationDirectory;
|
private readonly string _destinationDirectory;
|
||||||
private readonly Settings _settings;
|
private readonly ImageResizerSettings _settings;
|
||||||
|
|
||||||
// Filenames to avoid according to https://learn.microsoft.com/windows/win32/fileio/naming-a-file#file-and-directory-names
|
// Filenames to avoid according to https://learn.microsoft.com/windows/win32/fileio/naming-a-file#file-and-directory-names
|
||||||
private static readonly string[] _avoidFilenames =
|
private static readonly string[] _avoidFilenames =
|
||||||
@@ -35,7 +35,7 @@ namespace ImageResizer.Models
|
|||||||
"LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9",
|
"LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9",
|
||||||
};
|
};
|
||||||
|
|
||||||
public ResizeOperation(string file, string destinationDirectory, Settings settings)
|
public ResizeOperation(string file, string destinationDirectory, ImageResizerSettings settings)
|
||||||
{
|
{
|
||||||
_file = file;
|
_file = file;
|
||||||
_destinationDirectory = destinationDirectory;
|
_destinationDirectory = destinationDirectory;
|
||||||
|
|||||||
@@ -9,16 +9,18 @@ using System.Collections.ObjectModel;
|
|||||||
using System.Collections.Specialized;
|
using System.Collections.Specialized;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
|
using System.IO;
|
||||||
using System.IO.Abstractions;
|
using System.IO.Abstractions;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
using ImageResizer.Models;
|
using ImageResizer.Models;
|
||||||
|
using OutGoingLanguageSettings = Microsoft.PowerToys.Settings.UI.Library.OutGoingLanguageSettings;
|
||||||
|
|
||||||
namespace ImageResizer.Properties
|
namespace ImageResizer.Properties
|
||||||
{
|
{
|
||||||
public sealed partial class Settings : IDataErrorInfo, INotifyPropertyChanged
|
public sealed partial class ImageResizerSettings : IDataErrorInfo, INotifyPropertyChanged
|
||||||
{
|
{
|
||||||
private static readonly IFileSystem _fileSystem = new FileSystem();
|
private static readonly IFileSystem _fileSystem = new FileSystem();
|
||||||
private static readonly JsonSerializerOptions _jsonSerializerOptions = new JsonSerializerOptions
|
private static readonly JsonSerializerOptions _jsonSerializerOptions = new JsonSerializerOptions
|
||||||
@@ -30,6 +32,7 @@ namespace ImageResizer.Properties
|
|||||||
// Used to synchronize access to the settings.json file
|
// Used to synchronize access to the settings.json file
|
||||||
private static Mutex _jsonMutex = new Mutex();
|
private static Mutex _jsonMutex = new Mutex();
|
||||||
private static string _settingsPath = _fileSystem.Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData), "Microsoft", "PowerToys", "Image Resizer", "settings.json");
|
private static string _settingsPath = _fileSystem.Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData), "Microsoft", "PowerToys", "Image Resizer", "settings.json");
|
||||||
|
private static string _languagePath = _fileSystem.Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData), "Microsoft", "PowerToys", "language.json");
|
||||||
private string _fileNameFormat;
|
private string _fileNameFormat;
|
||||||
private bool _shrinkOnly;
|
private bool _shrinkOnly;
|
||||||
private int _selectedSizeIndex;
|
private int _selectedSizeIndex;
|
||||||
@@ -43,8 +46,9 @@ namespace ImageResizer.Properties
|
|||||||
private bool _keepDateModified;
|
private bool _keepDateModified;
|
||||||
private System.Guid _fallbackEncoder;
|
private System.Guid _fallbackEncoder;
|
||||||
private CustomSize _customSize;
|
private CustomSize _customSize;
|
||||||
|
private string _languageTag;
|
||||||
|
|
||||||
public Settings()
|
public ImageResizerSettings()
|
||||||
{
|
{
|
||||||
SelectedSizeIndex = 0;
|
SelectedSizeIndex = 0;
|
||||||
ShrinkOnly = false;
|
ShrinkOnly = false;
|
||||||
@@ -66,6 +70,21 @@ namespace ImageResizer.Properties
|
|||||||
FallbackEncoder = new System.Guid("19e4a5aa-5662-4fc5-a0c0-1758028e1057");
|
FallbackEncoder = new System.Guid("19e4a5aa-5662-4fc5-a0c0-1758028e1057");
|
||||||
CustomSize = new CustomSize(ResizeFit.Fit, 1024, 640, ResizeUnit.Pixel);
|
CustomSize = new CustomSize(ResizeFit.Fit, 1024, 640, ResizeUnit.Pixel);
|
||||||
AllSizes = new AllSizesCollection(this);
|
AllSizes = new AllSizesCollection(this);
|
||||||
|
|
||||||
|
LoadLanguage();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LoadLanguage()
|
||||||
|
{
|
||||||
|
if (!File.Exists(_languagePath))
|
||||||
|
{
|
||||||
|
LanguageTag = string.Empty;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string jsonSettingsString = System.IO.File.ReadAllText(_languagePath);
|
||||||
|
LanguageTag = JsonSerializer.Deserialize<OutGoingLanguageSettings>(jsonSettingsString).LanguageTag;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
@@ -134,7 +153,7 @@ namespace ImageResizer.Properties
|
|||||||
private ObservableCollection<ResizeSize> _sizes;
|
private ObservableCollection<ResizeSize> _sizes;
|
||||||
private CustomSize _customSize;
|
private CustomSize _customSize;
|
||||||
|
|
||||||
public AllSizesCollection(Settings settings)
|
public AllSizesCollection(ImageResizerSettings settings)
|
||||||
{
|
{
|
||||||
_sizes = settings.Sizes;
|
_sizes = settings.Sizes;
|
||||||
_customSize = settings.CustomSize;
|
_customSize = settings.CustomSize;
|
||||||
@@ -227,10 +246,10 @@ namespace ImageResizer.Properties
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Settings defaultInstance = new Settings();
|
private static ImageResizerSettings defaultInstance = new ImageResizerSettings();
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public static Settings Default
|
public static ImageResizerSettings Default
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
@@ -402,6 +421,15 @@ namespace ImageResizer.Properties
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string LanguageTag
|
||||||
|
{
|
||||||
|
get => _languageTag;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_languageTag = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static string SettingsPath { get => _settingsPath; set => _settingsPath = value; }
|
public static string SettingsPath { get => _settingsPath; set => _settingsPath = value; }
|
||||||
|
|
||||||
public event PropertyChangedEventHandler PropertyChanged;
|
public event PropertyChangedEventHandler PropertyChanged;
|
||||||
@@ -444,7 +472,7 @@ namespace ImageResizer.Properties
|
|||||||
}
|
}
|
||||||
|
|
||||||
string jsonData = _fileSystem.File.ReadAllText(SettingsPath);
|
string jsonData = _fileSystem.File.ReadAllText(SettingsPath);
|
||||||
var jsonSettings = new Settings();
|
var jsonSettings = new ImageResizerSettings();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
jsonSettings = JsonSerializer.Deserialize<SettingsWrapper>(jsonData, _jsonSerializerOptions)?.Properties;
|
jsonSettings = JsonSerializer.Deserialize<SettingsWrapper>(jsonData, _jsonSerializerOptions)?.Properties;
|
||||||
@@ -15,6 +15,6 @@ namespace ImageResizer.Properties
|
|||||||
public string Version { get; set; } = "1";
|
public string Version { get; set; } = "1";
|
||||||
|
|
||||||
[JsonPropertyName("properties")]
|
[JsonPropertyName("properties")]
|
||||||
public Settings Properties { get; set; }
|
public ImageResizerSettings Properties { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ namespace ImageResizer.ViewModels
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public AdvancedViewModel(Settings settings)
|
public AdvancedViewModel(ImageResizerSettings settings)
|
||||||
{
|
{
|
||||||
RemoveSizeCommand = new RelayCommand<ResizeSize>(RemoveSize);
|
RemoveSizeCommand = new RelayCommand<ResizeSize>(RemoveSize);
|
||||||
AddSizeCommand = new RelayCommand(AddSize);
|
AddSizeCommand = new RelayCommand(AddSize);
|
||||||
@@ -44,7 +44,7 @@ namespace ImageResizer.ViewModels
|
|||||||
|
|
||||||
public static IDictionary<Guid, string> EncoderMap { get; } = InitEncoderMap();
|
public static IDictionary<Guid, string> EncoderMap { get; } = InitEncoderMap();
|
||||||
|
|
||||||
public Settings Settings { get; }
|
public ImageResizerSettings Settings { get; }
|
||||||
|
|
||||||
public static string Version
|
public static string Version
|
||||||
=> typeof(AdvancedViewModel).Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()
|
=> typeof(AdvancedViewModel).Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ namespace ImageResizer.ViewModels
|
|||||||
}
|
}
|
||||||
|
|
||||||
public InputViewModel(
|
public InputViewModel(
|
||||||
Settings settings,
|
ImageResizerSettings settings,
|
||||||
MainViewModel mainViewModel,
|
MainViewModel mainViewModel,
|
||||||
IMainView mainView,
|
IMainView mainView,
|
||||||
ResizeBatch batch)
|
ResizeBatch batch)
|
||||||
@@ -53,7 +53,7 @@ namespace ImageResizer.ViewModels
|
|||||||
EnterKeyPressedCommand = new RelayCommand<KeyPressParams>(HandleEnterKeyPress);
|
EnterKeyPressedCommand = new RelayCommand<KeyPressParams>(HandleEnterKeyPress);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Settings Settings { get; }
|
public ImageResizerSettings Settings { get; }
|
||||||
|
|
||||||
public ICommand ResizeCommand { get; }
|
public ICommand ResizeCommand { get; }
|
||||||
|
|
||||||
|
|||||||
@@ -13,16 +13,18 @@ namespace ImageResizer.ViewModels
|
|||||||
{
|
{
|
||||||
public class MainViewModel : Observable
|
public class MainViewModel : Observable
|
||||||
{
|
{
|
||||||
private readonly Settings _settings;
|
private readonly ImageResizerSettings _settings;
|
||||||
private readonly ResizeBatch _batch;
|
private readonly ResizeBatch _batch;
|
||||||
|
|
||||||
private object _currentPage;
|
private object _currentPage;
|
||||||
private double _progress;
|
private double _progress;
|
||||||
|
private string _languageTag;
|
||||||
|
|
||||||
public MainViewModel(ResizeBatch batch, Settings settings)
|
public MainViewModel(ResizeBatch batch, ImageResizerSettings settings)
|
||||||
{
|
{
|
||||||
_batch = batch;
|
_batch = batch;
|
||||||
_settings = settings;
|
_settings = settings;
|
||||||
|
_languageTag = settings.LanguageTag;
|
||||||
LoadCommand = new RelayCommand<IMainView>(Load);
|
LoadCommand = new RelayCommand<IMainView>(Load);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,6 +42,12 @@ namespace ImageResizer.ViewModels
|
|||||||
set => Set(ref _progress, value);
|
set => Set(ref _progress, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string LanguageTag
|
||||||
|
{
|
||||||
|
get => _languageTag;
|
||||||
|
set => Set(ref _languageTag, value);
|
||||||
|
}
|
||||||
|
|
||||||
public void Load(IMainView view)
|
public void Load(IMainView view)
|
||||||
{
|
{
|
||||||
if (_batch.Files.Count == 0)
|
if (_batch.Files.Count == 0)
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using ImageResizer.ViewModels;
|
using ImageResizer.ViewModels;
|
||||||
using Microsoft.Win32;
|
using Microsoft.Win32;
|
||||||
@@ -17,6 +18,19 @@ namespace ImageResizer.Views
|
|||||||
public MainWindow(MainViewModel viewModel)
|
public MainWindow(MainViewModel viewModel)
|
||||||
{
|
{
|
||||||
DataContext = viewModel;
|
DataContext = viewModel;
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(viewModel.LanguageTag))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
ImageResizer.Properties.Resources.Culture = new System.Globalization.CultureInfo(viewModel.LanguageTag);
|
||||||
|
}
|
||||||
|
catch (CultureNotFoundException)
|
||||||
|
{
|
||||||
|
// Add logging here
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Wpf.Ui.Appearance.Watcher.Watch(this);
|
Wpf.Ui.Appearance.Watcher.Watch(this);
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -140,11 +140,24 @@ namespace PowerLauncher
|
|||||||
StringMatcher.Instance = _stringMatcher;
|
StringMatcher.Instance = _stringMatcher;
|
||||||
_stringMatcher.UserSettingSearchPrecision = _settings.QuerySearchPrecision;
|
_stringMatcher.UserSettingSearchPrecision = _settings.QuerySearchPrecision;
|
||||||
|
|
||||||
|
_settingsReader = new SettingsReader(_settings, _themeManager);
|
||||||
|
_settingsReader.ReadSettings();
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(_settings.Language))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
PowerLauncher.Properties.Resources.Culture = new System.Globalization.CultureInfo(_settings.Language);
|
||||||
|
}
|
||||||
|
catch (CultureNotFoundException ex)
|
||||||
|
{
|
||||||
|
Log.Exception("Error setting language: ", ex, GetType());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
_mainVM = new MainViewModel(_settings, NativeThreadCTS.Token);
|
_mainVM = new MainViewModel(_settings, NativeThreadCTS.Token);
|
||||||
_mainWindow = new MainWindow(_settings, _mainVM, NativeThreadCTS.Token);
|
_mainWindow = new MainWindow(_settings, _mainVM, NativeThreadCTS.Token);
|
||||||
API = new PublicAPIInstance(_settingsVM, _mainVM, _alphabet, _themeManager);
|
API = new PublicAPIInstance(_settingsVM, _mainVM, _alphabet, _themeManager);
|
||||||
_settingsReader = new SettingsReader(_settings, _themeManager);
|
|
||||||
_settingsReader.ReadSettings();
|
|
||||||
|
|
||||||
PluginManager.InitializePlugins(API);
|
PluginManager.InitializePlugins(API);
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reactive.Linq;
|
using System.Reactive.Linq;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||||
// See the LICENSE file in the project root for more information.
|
// See the LICENSE file in the project root for more information.
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.IO.Abstractions;
|
using System.IO.Abstractions;
|
||||||
@@ -44,6 +45,36 @@ namespace PowerLauncher
|
|||||||
|
|
||||||
// Apply theme at startup
|
// Apply theme at startup
|
||||||
_themeManager.ChangeTheme(_settings.Theme, true);
|
_themeManager.ChangeTheme(_settings.Theme, true);
|
||||||
|
|
||||||
|
LoadLanguage();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LoadLanguage()
|
||||||
|
{
|
||||||
|
FileSystem fs = new FileSystem();
|
||||||
|
|
||||||
|
string languagePath = fs.Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData), "Microsoft", "PowerToys", "language.json");
|
||||||
|
|
||||||
|
if (fs.File.Exists(languagePath))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
string languageJson = fs.File.ReadAllText(languagePath);
|
||||||
|
var language = System.Text.Json.JsonSerializer.Deserialize<OutGoingLanguageSettings>(languageJson);
|
||||||
|
if (language != null)
|
||||||
|
{
|
||||||
|
_settings.Language = language.LanguageTag;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (JsonException e)
|
||||||
|
{
|
||||||
|
Log.Exception("Exception when loading language file", e, GetType());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_settings.Language = string.Empty;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CreateSettingsIfNotExists()
|
public void CreateSettingsIfNotExists()
|
||||||
|
|||||||
@@ -177,7 +177,8 @@ namespace Wox.Infrastructure.UserSettings
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Language { get; set; } = "en";
|
[JsonIgnore]
|
||||||
|
public string Language { get; set; } = string.Empty;
|
||||||
|
|
||||||
public Theme Theme { get; set; } = Theme.System;
|
public Theme Theme { get; set; } = Theme.System;
|
||||||
|
|
||||||
|
|||||||
@@ -238,11 +238,17 @@ void dispatch_received_json(const std::wstring& json_to_parse)
|
|||||||
}
|
}
|
||||||
else if (name == L"killrunner")
|
else if (name == L"killrunner")
|
||||||
{
|
{
|
||||||
const auto pt_main_window = FindWindowW(pt_tray_icon_window_class, nullptr);
|
const auto pt_main_window = FindWindowW(pt_tray_icon_window_class, nullptr);
|
||||||
if (pt_main_window != nullptr)
|
if (pt_main_window != nullptr)
|
||||||
{
|
{
|
||||||
SendMessageW(pt_main_window, WM_CLOSE, 0, 0);
|
SendMessageW(pt_main_window, WM_CLOSE, 0, 0);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else if (name == L"language")
|
||||||
|
{
|
||||||
|
constexpr const wchar_t* language_filename = L"\\language.json";
|
||||||
|
const std::wstring save_file_location = PTSettingsHelper::get_root_save_folder_location() + language_filename;
|
||||||
|
json::to_file(save_file_location, j);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|||||||
50
src/settings-ui/Settings.UI.Library/LanguageModel.cs
Normal file
50
src/settings-ui/Settings.UI.Library/LanguageModel.cs
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
// 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;
|
||||||
|
using System.IO;
|
||||||
|
using System.IO.Abstractions;
|
||||||
|
using System.Text.Json;
|
||||||
|
using Microsoft.PowerToys.Settings.UI.Library;
|
||||||
|
|
||||||
|
namespace Settings.UI.Library
|
||||||
|
{
|
||||||
|
public class LanguageModel
|
||||||
|
{
|
||||||
|
public const string SettingsFilePath = "\\Microsoft\\PowerToys\\";
|
||||||
|
public const string SettingsFile = "language.json";
|
||||||
|
|
||||||
|
public string Tag { get; set; }
|
||||||
|
|
||||||
|
public string ResourceID { get; set; }
|
||||||
|
|
||||||
|
public string Language { get; set; }
|
||||||
|
|
||||||
|
public static string LoadSetting()
|
||||||
|
{
|
||||||
|
FileSystem fileSystem = new FileSystem();
|
||||||
|
var localAppDataDir = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
|
||||||
|
var file = localAppDataDir + SettingsFilePath + SettingsFile;
|
||||||
|
|
||||||
|
if (fileSystem.File.Exists(file))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Stream inputStream = fileSystem.File.Open(file, FileMode.Open);
|
||||||
|
StreamReader reader = new StreamReader(inputStream);
|
||||||
|
string data = reader.ReadToEnd();
|
||||||
|
inputStream.Close();
|
||||||
|
reader.Dispose();
|
||||||
|
|
||||||
|
return JsonSerializer.Deserialize<OutGoingLanguageSettings>(data).LanguageTag;
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return string.Empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
// 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.Text.Json;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
|
namespace Microsoft.PowerToys.Settings.UI.Library
|
||||||
|
{
|
||||||
|
public class OutGoingLanguageSettings
|
||||||
|
{
|
||||||
|
[JsonPropertyName("language")]
|
||||||
|
public string LanguageTag { get; set; }
|
||||||
|
|
||||||
|
public OutGoingLanguageSettings()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public OutGoingLanguageSettings(string language)
|
||||||
|
{
|
||||||
|
LanguageTag = language;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
return JsonSerializer.Serialize(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
|
using Microsoft.PowerToys.Settings.UI.Helpers;
|
||||||
using Microsoft.UI.Xaml.Data;
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
|
||||||
namespace Microsoft.PowerToys.Settings.UI.Converters
|
namespace Microsoft.PowerToys.Settings.UI.Converters
|
||||||
@@ -21,9 +22,9 @@ namespace Microsoft.PowerToys.Settings.UI.Converters
|
|||||||
string targetValue = string.Empty;
|
string targetValue = string.Empty;
|
||||||
switch (value)
|
switch (value)
|
||||||
{
|
{
|
||||||
case 0: targetValue = Helpers.ResourceLoaderInstance.ResourceLoader.GetString("ImageResizer_Fit_Fill_ThirdPersonSingular"); break;
|
case 0: targetValue = LocalizerInstance.Instance.GetLocalizedString("ImageResizer_Fit_Fill_ThirdPersonSingular"); break;
|
||||||
case 1: targetValue = Helpers.ResourceLoaderInstance.ResourceLoader.GetString("ImageResizer_Fit_Fit_ThirdPersonSingular"); break;
|
case 1: targetValue = LocalizerInstance.Instance.GetLocalizedString("ImageResizer_Fit_Fit_ThirdPersonSingular"); break;
|
||||||
case 2: targetValue = Helpers.ResourceLoaderInstance.ResourceLoader.GetString("ImageResizer_Fit_Stretch_ThirdPersonSingular"); break;
|
case 2: targetValue = LocalizerInstance.Instance.GetLocalizedString("ImageResizer_Fit_Stretch_ThirdPersonSingular"); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (toLower)
|
if (toLower)
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
|
using Microsoft.PowerToys.Settings.UI.Helpers;
|
||||||
using Microsoft.UI.Xaml.Data;
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
|
||||||
namespace Microsoft.PowerToys.Settings.UI.Converters
|
namespace Microsoft.PowerToys.Settings.UI.Converters
|
||||||
@@ -21,10 +22,10 @@ namespace Microsoft.PowerToys.Settings.UI.Converters
|
|||||||
string targetValue = string.Empty;
|
string targetValue = string.Empty;
|
||||||
switch (value)
|
switch (value)
|
||||||
{
|
{
|
||||||
case 0: targetValue = Helpers.ResourceLoaderInstance.ResourceLoader.GetString("ImageResizer_Unit_Centimeter"); break;
|
case 0: targetValue = LocalizerInstance.Instance.GetLocalizedString("ImageResizer_Unit_Centimeter"); break;
|
||||||
case 1: targetValue = Helpers.ResourceLoaderInstance.ResourceLoader.GetString("ImageResizer_Unit_Inch"); break;
|
case 1: targetValue = LocalizerInstance.Instance.GetLocalizedString("ImageResizer_Unit_Inch"); break;
|
||||||
case 2: targetValue = Helpers.ResourceLoaderInstance.ResourceLoader.GetString("ImageResizer_Unit_Percent"); break;
|
case 2: targetValue = LocalizerInstance.Instance.GetLocalizedString("ImageResizer_Unit_Percent"); break;
|
||||||
case 3: targetValue = Helpers.ResourceLoaderInstance.ResourceLoader.GetString("ImageResizer_Unit_Pixel"); break;
|
case 3: targetValue = LocalizerInstance.Instance.GetLocalizedString("ImageResizer_Unit_Pixel"); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (toLower)
|
if (toLower)
|
||||||
|
|||||||
37
src/settings-ui/Settings.UI/Helpers/LocalizerInstance.cs
Normal file
37
src/settings-ui/Settings.UI/Helpers/LocalizerInstance.cs
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
// 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;
|
||||||
|
using System.IO;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Windows.Storage;
|
||||||
|
using WinUI3Localizer;
|
||||||
|
|
||||||
|
namespace Microsoft.PowerToys.Settings.UI.Helpers
|
||||||
|
{
|
||||||
|
internal static class LocalizerInstance
|
||||||
|
{
|
||||||
|
internal static ILocalizer Instance { get; private set; }
|
||||||
|
|
||||||
|
static LocalizerInstance()
|
||||||
|
{
|
||||||
|
InitializeLocalizer().Wait();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static async Task InitializeLocalizer()
|
||||||
|
{
|
||||||
|
// Initialize a "Strings" folder in the executables folder.
|
||||||
|
string stringsPath = Path.Combine(AppContext.BaseDirectory, "Strings", "Settings");
|
||||||
|
|
||||||
|
Instance = await new LocalizerBuilder()
|
||||||
|
.AddStringResourcesFolderForLanguageDictionaries(stringsPath)
|
||||||
|
.SetOptions(options =>
|
||||||
|
{
|
||||||
|
options.DefaultLanguage = "de-DE";
|
||||||
|
options.UseUidWhenLocalizedStringNotFound = true;
|
||||||
|
})
|
||||||
|
.Build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
// 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 Microsoft.Windows.ApplicationModel.Resources;
|
|
||||||
|
|
||||||
namespace Microsoft.PowerToys.Settings.UI.Helpers
|
|
||||||
{
|
|
||||||
internal static class ResourceExtensions
|
|
||||||
{
|
|
||||||
private static readonly ResourceLoader ResLoader = ResourceLoaderInstance.ResourceLoader;
|
|
||||||
|
|
||||||
public static string GetLocalized(this string resourceKey)
|
|
||||||
{
|
|
||||||
return ResLoader.GetString(resourceKey);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
// 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 Microsoft.Windows.ApplicationModel.Resources;
|
|
||||||
|
|
||||||
namespace Microsoft.PowerToys.Settings.UI.Helpers
|
|
||||||
{
|
|
||||||
internal static class ResourceLoaderInstance
|
|
||||||
{
|
|
||||||
internal static ResourceLoader ResourceLoader { get; private set; }
|
|
||||||
|
|
||||||
static ResourceLoaderInstance()
|
|
||||||
{
|
|
||||||
ResourceLoader = new Microsoft.Windows.ApplicationModel.Resources.ResourceLoader("PowerToys.Settings.pri");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -82,8 +82,9 @@
|
|||||||
<PackageReference Include="Microsoft.Windows.CsWinRT" />
|
<PackageReference Include="Microsoft.Windows.CsWinRT" />
|
||||||
<PackageReference Include="CommunityToolkit.WinUI.UI" />
|
<PackageReference Include="CommunityToolkit.WinUI.UI" />
|
||||||
<PackageReference Include="CommunityToolkit.WinUI.UI.Controls" />
|
<PackageReference Include="CommunityToolkit.WinUI.UI.Controls" />
|
||||||
<PackageReference Include="WinUIEx" />
|
<PackageReference Include="WinUIEx" />
|
||||||
<PackageReference Include="Microsoft.WindowsAppSDK" />
|
<PackageReference Include="WinUI3Localizer" />
|
||||||
|
<PackageReference Include="Microsoft.WindowsAppSDK" />
|
||||||
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" />
|
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" />
|
||||||
<PackageReference Include="Microsoft.Xaml.Behaviors.WinUI.Managed" />
|
<PackageReference Include="Microsoft.Xaml.Behaviors.WinUI.Managed" />
|
||||||
<PackageReference Include="StreamJsonRpc" />
|
<PackageReference Include="StreamJsonRpc" />
|
||||||
@@ -122,5 +123,9 @@
|
|||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||||
|
<Exec Command="if not exist "..\..\..\$(Platform)\$(Configuration)\WinUI3Apps\Strings\Settings\" (
 mkdir "..\..\..\$(Platform)\$(Configuration)\WinUI3Apps\Strings\Settings\"
 xcopy "Strings" "..\..\..\$(Platform)\$(Configuration)\WinUI3Apps\Strings\Settings" /F /R /Y /I /S /C
)" />
|
||||||
|
</Target>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
x:Class="Microsoft.PowerToys.Settings.UI.App"
|
x:Class="Microsoft.PowerToys.Settings.UI.App"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
||||||
xmlns:converters="using:CommunityToolkit.WinUI.UI.Converters"
|
xmlns:converters="using:CommunityToolkit.WinUI.UI.Converters"
|
||||||
xmlns:labs="using:CommunityToolkit.Labs.WinUI"
|
xmlns:labs="using:CommunityToolkit.Labs.WinUI"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
x:Class="Microsoft.PowerToys.Settings.UI.Controls.AlphaColorPickerButton"
|
x:Class="Microsoft.PowerToys.Settings.UI.Controls.AlphaColorPickerButton"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Controls"
|
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Controls"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
x:Class="Microsoft.PowerToys.Settings.UI.Controls.ColorFormatEditor"
|
x:Class="Microsoft.PowerToys.Settings.UI.Controls.ColorFormatEditor"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:CommunityToolkit="using:CommunityToolkit.WinUI.UI.Controls"
|
xmlns:CommunityToolkit="using:CommunityToolkit.WinUI.UI.Controls"
|
||||||
xmlns:converters="using:Microsoft.PowerToys.Settings.UI.Converters"
|
xmlns:converters="using:Microsoft.PowerToys.Settings.UI.Converters"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
|||||||
@@ -27,48 +27,47 @@ namespace Microsoft.PowerToys.Settings.UI.Controls
|
|||||||
|
|
||||||
public void LoadParameters()
|
public void LoadParameters()
|
||||||
{
|
{
|
||||||
ResourceLoader resourceLoader = ResourceLoaderInstance.ResourceLoader;
|
|
||||||
ParametersItemsControl.ItemsSource = new List<ColorFormatParameter>
|
ParametersItemsControl.ItemsSource = new List<ColorFormatParameter>
|
||||||
{
|
{
|
||||||
new ColorFormatParameter() { Parameter = "%Re", Description = resourceLoader.GetString("Help_red") },
|
new ColorFormatParameter() { Parameter = "%Re", Description = LocalizerInstance.Instance.GetLocalizedString("Help_red") },
|
||||||
new ColorFormatParameter() { Parameter = "%Gr", Description = resourceLoader.GetString("Help_green") },
|
new ColorFormatParameter() { Parameter = "%Gr", Description = LocalizerInstance.Instance.GetLocalizedString("Help_green") },
|
||||||
new ColorFormatParameter() { Parameter = "%Bl", Description = resourceLoader.GetString("Help_blue") },
|
new ColorFormatParameter() { Parameter = "%Bl", Description = LocalizerInstance.Instance.GetLocalizedString("Help_blue") },
|
||||||
new ColorFormatParameter() { Parameter = "%Al", Description = resourceLoader.GetString("Help_alpha") },
|
new ColorFormatParameter() { Parameter = "%Al", Description = LocalizerInstance.Instance.GetLocalizedString("Help_alpha") },
|
||||||
new ColorFormatParameter() { Parameter = "%Cy", Description = resourceLoader.GetString("Help_cyan") },
|
new ColorFormatParameter() { Parameter = "%Cy", Description = LocalizerInstance.Instance.GetLocalizedString("Help_cyan") },
|
||||||
new ColorFormatParameter() { Parameter = "%Ma", Description = resourceLoader.GetString("Help_magenta") },
|
new ColorFormatParameter() { Parameter = "%Ma", Description = LocalizerInstance.Instance.GetLocalizedString("Help_magenta") },
|
||||||
new ColorFormatParameter() { Parameter = "%Ye", Description = resourceLoader.GetString("Help_yellow") },
|
new ColorFormatParameter() { Parameter = "%Ye", Description = LocalizerInstance.Instance.GetLocalizedString("Help_yellow") },
|
||||||
new ColorFormatParameter() { Parameter = "%Bk", Description = resourceLoader.GetString("Help_black_key") },
|
new ColorFormatParameter() { Parameter = "%Bk", Description = LocalizerInstance.Instance.GetLocalizedString("Help_black_key") },
|
||||||
new ColorFormatParameter() { Parameter = "%Hu", Description = resourceLoader.GetString("Help_hue") },
|
new ColorFormatParameter() { Parameter = "%Hu", Description = LocalizerInstance.Instance.GetLocalizedString("Help_hue") },
|
||||||
new ColorFormatParameter() { Parameter = "%Si", Description = resourceLoader.GetString("Help_saturationI") },
|
new ColorFormatParameter() { Parameter = "%Si", Description = LocalizerInstance.Instance.GetLocalizedString("Help_saturationI") },
|
||||||
new ColorFormatParameter() { Parameter = "%Sl", Description = resourceLoader.GetString("Help_saturationL") },
|
new ColorFormatParameter() { Parameter = "%Sl", Description = LocalizerInstance.Instance.GetLocalizedString("Help_saturationL") },
|
||||||
new ColorFormatParameter() { Parameter = "%Sb", Description = resourceLoader.GetString("Help_saturationB") },
|
new ColorFormatParameter() { Parameter = "%Sb", Description = LocalizerInstance.Instance.GetLocalizedString("Help_saturationB") },
|
||||||
new ColorFormatParameter() { Parameter = "%Br", Description = resourceLoader.GetString("Help_brightness") },
|
new ColorFormatParameter() { Parameter = "%Br", Description = LocalizerInstance.Instance.GetLocalizedString("Help_brightness") },
|
||||||
new ColorFormatParameter() { Parameter = "%In", Description = resourceLoader.GetString("Help_intensity") },
|
new ColorFormatParameter() { Parameter = "%In", Description = LocalizerInstance.Instance.GetLocalizedString("Help_intensity") },
|
||||||
new ColorFormatParameter() { Parameter = "%Hn", Description = resourceLoader.GetString("Help_hueNat") },
|
new ColorFormatParameter() { Parameter = "%Hn", Description = LocalizerInstance.Instance.GetLocalizedString("Help_hueNat") },
|
||||||
new ColorFormatParameter() { Parameter = "%Ll", Description = resourceLoader.GetString("Help_lightnessNat") },
|
new ColorFormatParameter() { Parameter = "%Ll", Description = LocalizerInstance.Instance.GetLocalizedString("Help_lightnessNat") },
|
||||||
new ColorFormatParameter() { Parameter = "%Lc", Description = resourceLoader.GetString("Help_lightnessCIE") },
|
new ColorFormatParameter() { Parameter = "%Lc", Description = LocalizerInstance.Instance.GetLocalizedString("Help_lightnessCIE") },
|
||||||
new ColorFormatParameter() { Parameter = "%Va", Description = resourceLoader.GetString("Help_value") },
|
new ColorFormatParameter() { Parameter = "%Va", Description = LocalizerInstance.Instance.GetLocalizedString("Help_value") },
|
||||||
new ColorFormatParameter() { Parameter = "%Wh", Description = resourceLoader.GetString("Help_whiteness") },
|
new ColorFormatParameter() { Parameter = "%Wh", Description = LocalizerInstance.Instance.GetLocalizedString("Help_whiteness") },
|
||||||
new ColorFormatParameter() { Parameter = "%Bn", Description = resourceLoader.GetString("Help_blackness") },
|
new ColorFormatParameter() { Parameter = "%Bn", Description = LocalizerInstance.Instance.GetLocalizedString("Help_blackness") },
|
||||||
new ColorFormatParameter() { Parameter = "%Ca", Description = resourceLoader.GetString("Help_chromaticityA") },
|
new ColorFormatParameter() { Parameter = "%Ca", Description = LocalizerInstance.Instance.GetLocalizedString("Help_chromaticityA") },
|
||||||
new ColorFormatParameter() { Parameter = "%Cb", Description = resourceLoader.GetString("Help_chromaticityB") },
|
new ColorFormatParameter() { Parameter = "%Cb", Description = LocalizerInstance.Instance.GetLocalizedString("Help_chromaticityB") },
|
||||||
new ColorFormatParameter() { Parameter = "%Xv", Description = resourceLoader.GetString("Help_X_value") },
|
new ColorFormatParameter() { Parameter = "%Xv", Description = LocalizerInstance.Instance.GetLocalizedString("Help_X_value") },
|
||||||
new ColorFormatParameter() { Parameter = "%Yv", Description = resourceLoader.GetString("Help_Y_value") },
|
new ColorFormatParameter() { Parameter = "%Yv", Description = LocalizerInstance.Instance.GetLocalizedString("Help_Y_value") },
|
||||||
new ColorFormatParameter() { Parameter = "%Zv", Description = resourceLoader.GetString("Help_Z_value") },
|
new ColorFormatParameter() { Parameter = "%Zv", Description = LocalizerInstance.Instance.GetLocalizedString("Help_Z_value") },
|
||||||
new ColorFormatParameter() { Parameter = "%Dv", Description = resourceLoader.GetString("Help_decimal_value_BGR") },
|
new ColorFormatParameter() { Parameter = "%Dv", Description = LocalizerInstance.Instance.GetLocalizedString("Help_decimal_value_BGR") },
|
||||||
new ColorFormatParameter() { Parameter = "%Dr", Description = resourceLoader.GetString("Help_decimal_value_RGB") },
|
new ColorFormatParameter() { Parameter = "%Dr", Description = LocalizerInstance.Instance.GetLocalizedString("Help_decimal_value_RGB") },
|
||||||
new ColorFormatParameter() { Parameter = "%Na", Description = resourceLoader.GetString("Help_color_name") },
|
new ColorFormatParameter() { Parameter = "%Na", Description = LocalizerInstance.Instance.GetLocalizedString("Help_color_name") },
|
||||||
};
|
};
|
||||||
|
|
||||||
ColorParametersItemsControl.ItemsSource = new List<ColorFormatParameter>
|
ColorParametersItemsControl.ItemsSource = new List<ColorFormatParameter>
|
||||||
{
|
{
|
||||||
new ColorFormatParameter() { Parameter = "b", Description = resourceLoader.GetString("Help_byte") },
|
new ColorFormatParameter() { Parameter = "b", Description = LocalizerInstance.Instance.GetLocalizedString("Help_byte") },
|
||||||
new ColorFormatParameter() { Parameter = "h", Description = resourceLoader.GetString("Help_hexL1") },
|
new ColorFormatParameter() { Parameter = "h", Description = LocalizerInstance.Instance.GetLocalizedString("Help_hexL1") },
|
||||||
new ColorFormatParameter() { Parameter = "H", Description = resourceLoader.GetString("Help_hexU1") },
|
new ColorFormatParameter() { Parameter = "H", Description = LocalizerInstance.Instance.GetLocalizedString("Help_hexU1") },
|
||||||
new ColorFormatParameter() { Parameter = "x", Description = resourceLoader.GetString("Help_hexL2") },
|
new ColorFormatParameter() { Parameter = "x", Description = LocalizerInstance.Instance.GetLocalizedString("Help_hexL2") },
|
||||||
new ColorFormatParameter() { Parameter = "X", Description = resourceLoader.GetString("Help_hexU2") },
|
new ColorFormatParameter() { Parameter = "X", Description = LocalizerInstance.Instance.GetLocalizedString("Help_hexU2") },
|
||||||
new ColorFormatParameter() { Parameter = "f", Description = resourceLoader.GetString("Help_floatWith") },
|
new ColorFormatParameter() { Parameter = "f", Description = LocalizerInstance.Instance.GetLocalizedString("Help_floatWith") },
|
||||||
new ColorFormatParameter() { Parameter = "F", Description = resourceLoader.GetString("Help_floatWithout") },
|
new ColorFormatParameter() { Parameter = "F", Description = LocalizerInstance.Instance.GetLocalizedString("Help_floatWithout") },
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
x:Class="Microsoft.PowerToys.Settings.UI.Controls.ColorPickerButton"
|
x:Class="Microsoft.PowerToys.Settings.UI.Controls.ColorPickerButton"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Controls"
|
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Controls"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
x:Class="Microsoft.PowerToys.Settings.UI.Controls.FancyZonesPreviewControl"
|
x:Class="Microsoft.PowerToys.Settings.UI.Controls.FancyZonesPreviewControl"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
Loaded="FancyZonesPreviewControl_Loaded"
|
Loaded="FancyZonesPreviewControl_Loaded"
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
<ResourceDictionary
|
<ResourceDictionary
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Controls">
|
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Controls">
|
||||||
|
|
||||||
<Style BasedOn="{StaticResource DefaultFlyoutMenuButtonStyle}" TargetType="local:FlyoutMenuButton" />
|
<Style BasedOn="{StaticResource DefaultFlyoutMenuButtonStyle}" TargetType="local:FlyoutMenuButton" />
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<ResourceDictionary
|
<ResourceDictionary
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Controls">
|
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Controls">
|
||||||
|
|
||||||
<Style TargetType="local:IsEnabledTextBlock">
|
<Style TargetType="local:IsEnabledTextBlock">
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<ResourceDictionary
|
<ResourceDictionary
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Controls">
|
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Controls">
|
||||||
|
|
||||||
<x:Double x:Key="DefaultIconSize">16</x:Double>
|
<x:Double x:Key="DefaultIconSize">16</x:Double>
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
x:Class="Microsoft.PowerToys.Settings.UI.Controls.OOBEPageControl"
|
x:Class="Microsoft.PowerToys.Settings.UI.Controls.OOBEPageControl"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
d:DesignHeight="300"
|
d:DesignHeight="300"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
x:Class="Microsoft.PowerToys.Settings.UI.Controls.PowerAccentShortcutControl"
|
x:Class="Microsoft.PowerToys.Settings.UI.Controls.PowerAccentShortcutControl"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<ResourceDictionary
|
<ResourceDictionary
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls">
|
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls">
|
||||||
|
|
||||||
<Style TargetType="controls:SettingsGroup">
|
<Style TargetType="controls:SettingsGroup">
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
x:Class="Microsoft.PowerToys.Settings.UI.Controls.SettingsPageControl"
|
x:Class="Microsoft.PowerToys.Settings.UI.Controls.SettingsPageControl"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:controls="using:CommunityToolkit.WinUI.UI.Controls"
|
xmlns:controls="using:CommunityToolkit.WinUI.UI.Controls"
|
||||||
xmlns:converters="using:CommunityToolkit.WinUI.UI.Converters"
|
xmlns:converters="using:CommunityToolkit.WinUI.UI.Converters"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
x:Class="Microsoft.PowerToys.Settings.UI.Controls.ShortcutControl"
|
x:Class="Microsoft.PowerToys.Settings.UI.Controls.ShortcutControl"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Controls"
|
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Controls"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
|||||||
@@ -49,11 +49,9 @@ namespace Microsoft.PowerToys.Settings.UI.Controls
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var resourceLoader = Helpers.ResourceLoaderInstance.ResourceLoader;
|
|
||||||
|
|
||||||
var newValue = (bool)(e?.NewValue ?? false);
|
var newValue = (bool)(e?.NewValue ?? false);
|
||||||
|
|
||||||
var text = newValue ? resourceLoader.GetString("Activation_Shortcut_With_Disable_Description") : resourceLoader.GetString("Activation_Shortcut_Description");
|
var text = newValue ? LocalizerInstance.Instance.GetLocalizedString("Activation_Shortcut_With_Disable_Description") : LocalizerInstance.Instance.GetLocalizedString("Activation_Shortcut_Description");
|
||||||
description.Text = text;
|
description.Text = text;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -116,7 +114,6 @@ namespace Microsoft.PowerToys.Settings.UI.Controls
|
|||||||
|
|
||||||
this.Unloaded += ShortcutControl_Unloaded;
|
this.Unloaded += ShortcutControl_Unloaded;
|
||||||
hook = new HotkeySettingsControlHook(Hotkey_KeyDown, Hotkey_KeyUp, Hotkey_IsActive, FilterAccessibleKeyboardEvents);
|
hook = new HotkeySettingsControlHook(Hotkey_KeyDown, Hotkey_KeyUp, Hotkey_IsActive, FilterAccessibleKeyboardEvents);
|
||||||
var resourceLoader = Helpers.ResourceLoaderInstance.ResourceLoader;
|
|
||||||
|
|
||||||
if (App.GetSettingsWindow() != null)
|
if (App.GetSettingsWindow() != null)
|
||||||
{
|
{
|
||||||
@@ -127,11 +124,11 @@ namespace Microsoft.PowerToys.Settings.UI.Controls
|
|||||||
shortcutDialog = new ContentDialog
|
shortcutDialog = new ContentDialog
|
||||||
{
|
{
|
||||||
XamlRoot = this.XamlRoot,
|
XamlRoot = this.XamlRoot,
|
||||||
Title = resourceLoader.GetString("Activation_Shortcut_Title"),
|
Title = LocalizerInstance.Instance.GetLocalizedString("Activation_Shortcut_Title"),
|
||||||
Content = c,
|
Content = c,
|
||||||
PrimaryButtonText = resourceLoader.GetString("Activation_Shortcut_Save"),
|
PrimaryButtonText = LocalizerInstance.Instance.GetLocalizedString("Activation_Shortcut_Save"),
|
||||||
SecondaryButtonText = resourceLoader.GetString("Activation_Shortcut_Reset"),
|
SecondaryButtonText = LocalizerInstance.Instance.GetLocalizedString("Activation_Shortcut_Reset"),
|
||||||
CloseButtonText = resourceLoader.GetString("Activation_Shortcut_Cancel"),
|
CloseButtonText = LocalizerInstance.Instance.GetLocalizedString("Activation_Shortcut_Cancel"),
|
||||||
DefaultButton = ContentDialogButton.Primary,
|
DefaultButton = ContentDialogButton.Primary,
|
||||||
};
|
};
|
||||||
shortcutDialog.PrimaryButtonClick += ShortcutDialog_PrimaryButtonClick;
|
shortcutDialog.PrimaryButtonClick += ShortcutDialog_PrimaryButtonClick;
|
||||||
@@ -139,7 +136,7 @@ namespace Microsoft.PowerToys.Settings.UI.Controls
|
|||||||
shortcutDialog.RightTapped += ShortcutDialog_Disable;
|
shortcutDialog.RightTapped += ShortcutDialog_Disable;
|
||||||
shortcutDialog.Opened += ShortcutDialog_Opened;
|
shortcutDialog.Opened += ShortcutDialog_Opened;
|
||||||
shortcutDialog.Closing += ShortcutDialog_Closing;
|
shortcutDialog.Closing += ShortcutDialog_Closing;
|
||||||
AutomationProperties.SetName(EditButton, resourceLoader.GetString("Activation_Shortcut_Title"));
|
AutomationProperties.SetName(EditButton, LocalizerInstance.Instance.GetLocalizedString("Activation_Shortcut_Title"));
|
||||||
|
|
||||||
OnAllowDisableChanged(this, null);
|
OnAllowDisableChanged(this, null);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
x:Class="Microsoft.PowerToys.Settings.UI.Controls.ShortcutDialogContentControl"
|
x:Class="Microsoft.PowerToys.Settings.UI.Controls.ShortcutDialogContentControl"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Controls"
|
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Controls"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
x:Class="Microsoft.PowerToys.Settings.UI.Controls.ShortcutWithTextLabelControl"
|
x:Class="Microsoft.PowerToys.Settings.UI.Controls.ShortcutWithTextLabelControl"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Controls"
|
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Controls"
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
x:Class="Microsoft.PowerToys.Settings.UI.Flyout.AppsListPage"
|
x:Class="Microsoft.PowerToys.Settings.UI.Flyout.AppsListPage"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Flyout"
|
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Flyout"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
x:Class="Microsoft.PowerToys.Settings.UI.Flyout.LaunchPage"
|
x:Class="Microsoft.PowerToys.Settings.UI.Flyout.LaunchPage"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:animatedVisuals="using:Microsoft.UI.Xaml.Controls.AnimatedVisuals"
|
xmlns:animatedVisuals="using:Microsoft.UI.Xaml.Controls.AnimatedVisuals"
|
||||||
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
x:Class="Microsoft.PowerToys.Settings.UI.Flyout.ShellPage"
|
x:Class="Microsoft.PowerToys.Settings.UI.Flyout.ShellPage"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Flyout"
|
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Flyout"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
x:Class="Microsoft.PowerToys.Settings.UI.FlyoutWindow"
|
x:Class="Microsoft.PowerToys.Settings.UI.FlyoutWindow"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:flyout="using:Microsoft.PowerToys.Settings.UI.Flyout"
|
xmlns:flyout="using:Microsoft.PowerToys.Settings.UI.Flyout"
|
||||||
xmlns:local="using:Microsoft.PowerToys.Settings.UI"
|
xmlns:local="using:Microsoft.PowerToys.Settings.UI"
|
||||||
@@ -9,7 +10,7 @@
|
|||||||
xmlns:winuiex="using:WinUIEx"
|
xmlns:winuiex="using:WinUIEx"
|
||||||
xmlns:i="using:Microsoft.Xaml.Interactivity"
|
xmlns:i="using:Microsoft.Xaml.Interactivity"
|
||||||
xmlns:ic="using:Microsoft.Xaml.Interactions.Core"
|
xmlns:ic="using:Microsoft.Xaml.Interactions.Core"
|
||||||
Title="PowerToys Settings"
|
Title="PowerToys a a a a a a aSettings"
|
||||||
IsAlwaysOnTop="True"
|
IsAlwaysOnTop="True"
|
||||||
IsMaximizable="False"
|
IsMaximizable="False"
|
||||||
IsMinimizable="False"
|
IsMinimizable="False"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
x:Class="Microsoft.PowerToys.Settings.UI.MainWindow"
|
x:Class="Microsoft.PowerToys.Settings.UI.MainWindow"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Views"
|
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Views"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ using Microsoft.UI;
|
|||||||
using Microsoft.UI.Windowing;
|
using Microsoft.UI.Windowing;
|
||||||
using Microsoft.UI.Xaml;
|
using Microsoft.UI.Xaml;
|
||||||
using Windows.Data.Json;
|
using Windows.Data.Json;
|
||||||
|
using WinUI3Localizer;
|
||||||
using WinUIEx;
|
using WinUIEx;
|
||||||
|
|
||||||
namespace Microsoft.PowerToys.Settings.UI
|
namespace Microsoft.PowerToys.Settings.UI
|
||||||
@@ -50,8 +51,8 @@ namespace Microsoft.PowerToys.Settings.UI
|
|||||||
|
|
||||||
NativeMethods.SetWindowPlacement(hWnd, ref placement);
|
NativeMethods.SetWindowPlacement(hWnd, ref placement);
|
||||||
|
|
||||||
var loader = Helpers.ResourceLoaderInstance.ResourceLoader;
|
string title = LocalizerInstance.Instance.GetLocalizedString("SettingsWindow_Title");
|
||||||
Title = loader.GetString("SettingsWindow_Title");
|
Title = title;
|
||||||
|
|
||||||
// send IPC Message
|
// send IPC Message
|
||||||
ShellPage.SetDefaultSndMessageCallback(msg =>
|
ShellPage.SetDefaultSndMessageCallback(msg =>
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobeAlwaysOnTop"
|
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobeAlwaysOnTop"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
|
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobeAwake"
|
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobeAwake"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobeColorPicker"
|
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobeColorPicker"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
|
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobeCropAndLock"
|
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobeCropAndLock"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
|
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobeFancyZones"
|
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobeFancyZones"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobeFileExplorer"
|
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobeFileExplorer"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
|
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobeFileLocksmith"
|
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobeFileLocksmith"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
|
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobeHosts"
|
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobeHosts"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
|
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobeImageResizer"
|
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobeImageResizer"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
|
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobeKBM"
|
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobeKBM"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobeMeasureTool"
|
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobeMeasureTool"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
|
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobeMouseUtils"
|
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobeMouseUtils"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobeMouseWithoutBorders"
|
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobeMouseWithoutBorders"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
|
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobeOverview"
|
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobeOverview"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
|
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobeOverviewAlternate"
|
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobeOverviewAlternate"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
|
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobeOverviewPlaceholder"
|
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobeOverviewPlaceholder"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
|
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobePastePlain"
|
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobePastePlain"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
|
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobePeek"
|
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobePeek"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
||||||
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
|
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobePowerAccent"
|
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobePowerAccent"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
|
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobePowerOCR"
|
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobePowerOCR"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
|
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobePowerRename"
|
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobePowerRename"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
|
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobeRegistryPreview"
|
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobeRegistryPreview"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
|
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobeRun"
|
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobeRun"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
|
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobeShellPage"
|
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobeShellPage"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:animations="using:CommunityToolkit.WinUI.UI.Animations"
|
xmlns:animations="using:CommunityToolkit.WinUI.UI.Animations"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobeShortcutGuide"
|
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobeShortcutGuide"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
|
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobeVideoConference"
|
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobeVideoConference"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
|
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobeWhatsNew"
|
x:Class="Microsoft.PowerToys.Settings.UI.OOBE.Views.OobeWhatsNew"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
|
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
x:Class="Microsoft.PowerToys.Settings.UI.OobeWindow"
|
x:Class="Microsoft.PowerToys.Settings.UI.OobeWindow"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
|
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
|||||||
@@ -68,8 +68,7 @@ namespace Microsoft.PowerToys.Settings.UI
|
|||||||
|
|
||||||
this.SizeChanged += OobeWindow_SizeChanged;
|
this.SizeChanged += OobeWindow_SizeChanged;
|
||||||
|
|
||||||
var loader = Helpers.ResourceLoaderInstance.ResourceLoader;
|
Title = LocalizerInstance.Instance.GetLocalizedString("OobeWindow_Title");
|
||||||
Title = loader.GetString("OobeWindow_Title");
|
|
||||||
|
|
||||||
if (shellPage != null)
|
if (shellPage != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer">
|
||||||
|
|
||||||
<SolidColorBrush x:Key="SubtleButtonBackground" Color="{ThemeResource SubtleFillColorTransparent}" />
|
<SolidColorBrush x:Key="SubtleButtonBackground" Color="{ThemeResource SubtleFillColorTransparent}" />
|
||||||
<SolidColorBrush x:Key="SubtleButtonBackgroundPointerOver" Color="{ThemeResource SubtleFillColorSecondary}" />
|
<SolidColorBrush x:Key="SubtleButtonBackgroundPointerOver" Color="{ThemeResource SubtleFillColorSecondary}" />
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<ResourceDictionary
|
<ResourceDictionary
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer">
|
||||||
|
|
||||||
<Style
|
<Style
|
||||||
x:Key="OobeSubtitleStyle"
|
x:Key="OobeSubtitleStyle"
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<ResourceDictionary
|
<ResourceDictionary
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer">
|
||||||
|
|
||||||
<ResourceDictionary.ThemeDictionaries>
|
<ResourceDictionary.ThemeDictionaries>
|
||||||
<ResourceDictionary x:Key="Dark">
|
<ResourceDictionary x:Key="Dark">
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer">
|
||||||
|
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
<ResourceDictionary Source="ms-appx:///SettingsXAML/Controls/SettingsGroup/SettingsGroup.xaml" />
|
<ResourceDictionary Source="ms-appx:///SettingsXAML/Controls/SettingsGroup/SettingsGroup.xaml" />
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
x:Class="Microsoft.PowerToys.Settings.UI.Views.AlwaysOnTopPage"
|
x:Class="Microsoft.PowerToys.Settings.UI.Views.AlwaysOnTopPage"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:labs="using:CommunityToolkit.Labs.WinUI"
|
xmlns:labs="using:CommunityToolkit.Labs.WinUI"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
x:Class="Microsoft.PowerToys.Settings.UI.Views.AwakePage"
|
x:Class="Microsoft.PowerToys.Settings.UI.Views.AwakePage"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
||||||
xmlns:converters="using:Microsoft.PowerToys.Settings.UI.Converters"
|
xmlns:converters="using:Microsoft.PowerToys.Settings.UI.Converters"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
x:Class="Microsoft.PowerToys.Settings.UI.Views.ColorPickerPage"
|
x:Class="Microsoft.PowerToys.Settings.UI.Views.ColorPickerPage"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
||||||
xmlns:converters="using:CommunityToolkit.WinUI.UI.Converters"
|
xmlns:converters="using:CommunityToolkit.WinUI.UI.Converters"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
|||||||
@@ -22,8 +22,6 @@ namespace Microsoft.PowerToys.Settings.UI.Views
|
|||||||
|
|
||||||
public ICommand UpdateCommand => new RelayCommand(Update);
|
public ICommand UpdateCommand => new RelayCommand(Update);
|
||||||
|
|
||||||
private ResourceLoader resourceLoader = ResourceLoaderInstance.ResourceLoader;
|
|
||||||
|
|
||||||
public ColorPickerPage()
|
public ColorPickerPage()
|
||||||
{
|
{
|
||||||
var settingsUtils = new SettingsUtils();
|
var settingsUtils = new SettingsUtils();
|
||||||
@@ -89,10 +87,10 @@ namespace Microsoft.PowerToys.Settings.UI.Views
|
|||||||
ContentDialog dialog = new ContentDialog();
|
ContentDialog dialog = new ContentDialog();
|
||||||
dialog.XamlRoot = RootPage.XamlRoot;
|
dialog.XamlRoot = RootPage.XamlRoot;
|
||||||
dialog.Title = color.Name;
|
dialog.Title = color.Name;
|
||||||
dialog.PrimaryButtonText = resourceLoader.GetString("Yes");
|
dialog.PrimaryButtonText = LocalizerInstance.Instance.GetLocalizedString("Yes");
|
||||||
dialog.CloseButtonText = resourceLoader.GetString("No");
|
dialog.CloseButtonText = LocalizerInstance.Instance.GetLocalizedString("No");
|
||||||
dialog.DefaultButton = ContentDialogButton.Primary;
|
dialog.DefaultButton = ContentDialogButton.Primary;
|
||||||
dialog.Content = new TextBlock() { Text = resourceLoader.GetString("Delete_Dialog_Description") };
|
dialog.Content = new TextBlock() { Text = LocalizerInstance.Instance.GetLocalizedString("Delete_Dialog_Description") };
|
||||||
dialog.PrimaryButtonClick += (s, args) =>
|
dialog.PrimaryButtonClick += (s, args) =>
|
||||||
{
|
{
|
||||||
ViewModel.DeleteModel(color);
|
ViewModel.DeleteModel(color);
|
||||||
@@ -117,12 +115,12 @@ namespace Microsoft.PowerToys.Settings.UI.Views
|
|||||||
|
|
||||||
private async void NewFormatClick(object sender, Microsoft.UI.Xaml.RoutedEventArgs e)
|
private async void NewFormatClick(object sender, Microsoft.UI.Xaml.RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
ColorFormatDialog.Title = resourceLoader.GetString("AddCustomColorFormat");
|
ColorFormatDialog.Title = LocalizerInstance.Instance.GetLocalizedString("AddCustomColorFormat");
|
||||||
ColorFormatModel newColorFormatModel = ViewModel.GetNewColorFormatModel();
|
ColorFormatModel newColorFormatModel = ViewModel.GetNewColorFormatModel();
|
||||||
ColorFormatDialog.DataContext = newColorFormatModel;
|
ColorFormatDialog.DataContext = newColorFormatModel;
|
||||||
ColorFormatDialog.Tag = string.Empty;
|
ColorFormatDialog.Tag = string.Empty;
|
||||||
|
|
||||||
ColorFormatDialog.PrimaryButtonText = resourceLoader.GetString("ColorFormatSave");
|
ColorFormatDialog.PrimaryButtonText = LocalizerInstance.Instance.GetLocalizedString("ColorFormatSave");
|
||||||
ColorFormatDialog.PrimaryButtonCommand = AddCommand;
|
ColorFormatDialog.PrimaryButtonCommand = AddCommand;
|
||||||
await ColorFormatDialog.ShowAsync();
|
await ColorFormatDialog.ShowAsync();
|
||||||
}
|
}
|
||||||
@@ -144,11 +142,11 @@ namespace Microsoft.PowerToys.Settings.UI.Views
|
|||||||
{
|
{
|
||||||
SettingsCard btn = sender as SettingsCard;
|
SettingsCard btn = sender as SettingsCard;
|
||||||
ColorFormatModel colorFormatModel = btn.DataContext as ColorFormatModel;
|
ColorFormatModel colorFormatModel = btn.DataContext as ColorFormatModel;
|
||||||
ColorFormatDialog.Title = resourceLoader.GetString("EditCustomColorFormat");
|
ColorFormatDialog.Title = LocalizerInstance.Instance.GetLocalizedString("EditCustomColorFormat");
|
||||||
ColorFormatDialog.DataContext = colorFormatModel;
|
ColorFormatDialog.DataContext = colorFormatModel;
|
||||||
ColorFormatDialog.Tag = new KeyValuePair<string, string>(colorFormatModel.Name, colorFormatModel.Format);
|
ColorFormatDialog.Tag = new KeyValuePair<string, string>(colorFormatModel.Name, colorFormatModel.Format);
|
||||||
|
|
||||||
ColorFormatDialog.PrimaryButtonText = resourceLoader.GetString("ColorFormatUpdate");
|
ColorFormatDialog.PrimaryButtonText = LocalizerInstance.Instance.GetLocalizedString("ColorFormatUpdate");
|
||||||
ColorFormatDialog.PrimaryButtonCommand = UpdateCommand;
|
ColorFormatDialog.PrimaryButtonCommand = UpdateCommand;
|
||||||
await ColorFormatDialog.ShowAsync();
|
await ColorFormatDialog.ShowAsync();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
x:Class="Microsoft.PowerToys.Settings.UI.Views.CropAndLockPage"
|
x:Class="Microsoft.PowerToys.Settings.UI.Views.CropAndLockPage"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:labs="using:CommunityToolkit.Labs.WinUI"
|
xmlns:labs="using:CommunityToolkit.Labs.WinUI"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
x:Class="Microsoft.PowerToys.Settings.UI.Views.FancyZonesPage"
|
x:Class="Microsoft.PowerToys.Settings.UI.Views.FancyZonesPage"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:l="using:WinUI3Localizer"
|
||||||
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:labs="using:CommunityToolkit.Labs.WinUI"
|
xmlns:labs="using:CommunityToolkit.Labs.WinUI"
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user