diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index ceb5eef2e1..974f0c9252 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -1,11 +1,8 @@ name: "🐛 Bug report" description: Report errors or unexpected behavior -title: '' labels: - Issue-Bug - Triage-Needed -assignees: '' -issue_body: true body: - type: markdown attributes: @@ -56,7 +53,7 @@ body: - type: textarea attributes: label: Steps to reproduce - description: We highly suggest including a screenshots and a bug report log (System tray->Report bug). To include, paste them into the markdown editor below the form or follow up with a separate comment. + description: We highly suggest including a screenshots and a bug report log (System tray->Report bug). placeholder: Tell us the steps required to trigger your bug. validations: required: true diff --git a/.github/ISSUE_TEMPLATE/documentation-issue.md b/.github/ISSUE_TEMPLATE/documentation-issue.md deleted file mode 100644 index dc40b2f3fb..0000000000 --- a/.github/ISSUE_TEMPLATE/documentation-issue.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -name: "\U0001F4DA Documentation Issue" -about: Report issues in our documentation -title: '' -labels: Issue-Docs,Triage-Needed -assignees: '' - ---- - - - -## 📝 Provide a description of requested docs changes - -_What is the purpose and what should be changed?_ diff --git a/.github/ISSUE_TEMPLATE/documentation-issue.yml b/.github/ISSUE_TEMPLATE/documentation-issue.yml new file mode 100644 index 0000000000..c2b7de09a5 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/documentation-issue.yml @@ -0,0 +1,12 @@ +name: "📚 Documentation Issue" +description: Report issues in our documentation +labels: +- Issue-Docs +- Triage-Needed +body: +- type: textarea + attributes: + label: Provide a description of requested docs changes + placeholder: Briefly describe which document needs to be corrected and why. + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/translation_issue.yml b/.github/ISSUE_TEMPLATE/translation_issue.yml index 05f9289fc4..b1a382253f 100644 --- a/.github/ISSUE_TEMPLATE/translation_issue.yml +++ b/.github/ISSUE_TEMPLATE/translation_issue.yml @@ -1,22 +1,19 @@ name: "🌐 Localization/Translation issue" description: Report incorrect translations. -title: '' labels: - Issue-Bug - Area-Localization - Issue-Translation - Triage-Needed -assignees: '' -issue_body: true body: - type: markdown attributes: value: | - Please make sure to [search for existing issues](https://github.com/microsoft/PowerTOys/issues) before filing a new one! + Please make sure to [search for existing issues](https://github.com/microsoft/PowerToys/issues) before filing a new one! - type: input attributes: label: Microsoft PowerToys version - placeholder: "0.33.1" + placeholder: "0.35.0" description: | Hover over system tray icon or look at Settings validations: @@ -24,8 +21,6 @@ body: - type: dropdown attributes: label: Utility with translation issue - description: | - Please include a screenshot as that is extremely helpful. To include, paste them into the markdown editor below the form or follow up with a separate comment. options: - General - ColorPicker @@ -54,7 +49,7 @@ body: - type: textarea attributes: label: ❌ Actual phrase(s) - placeholder: What is there? + placeholder: What is there? Please include a screenshot as that is extremely helpful. validations: required: true - type: textarea diff --git a/.github/actions/spell-check/expect.txt b/.github/actions/spell-check/expect.txt index 375a764c79..69f2fdc975 100644 --- a/.github/actions/spell-check/expect.txt +++ b/.github/actions/spell-check/expect.txt @@ -192,6 +192,7 @@ buildtransitive BValue bytearray callbackptr +capitalized CANRENAME Captureascreenshot CAPTURECHANGED @@ -1585,6 +1586,8 @@ pguid phbm phbmp Phishing +php +phptest phwnd pici pid @@ -1700,6 +1703,7 @@ pwcs PWSTR pwtd px +py Qand QI qianlifeng @@ -1825,6 +1829,7 @@ runsettings runtimeclass runtimeconfig runtimes +rutkas rv rvalue rvm diff --git a/README.md b/README.md index 0d7e8d18d3..a08ff7bc7f 100644 --- a/README.md +++ b/README.md @@ -32,14 +32,12 @@ Microsoft PowerToys is a set of utilities for power users to tune and streamline #### Stable version -Install from the [Microsoft PowerToys GitHub releases page][github-release-link]. Click on `Assets` to show the files available in the release and then click on `PowerToysSetup-0.33.1-x64.exe` to download the PowerToys installer. +Install from the [Microsoft PowerToys GitHub releases page][github-release-link]. Click on `Assets` to show the files available in the release and then click on `PowerToysSetup-0.35.0-x64.exe` to download the PowerToys installer. This is our preferred method. #### Experimental version -To install the Video Conference mute, please use the [v0.28 pre-release experimental version of PowerToys][github-prerelease-link] to try out this version. It includes all improvements from v0.27 in addition to the Video conference utility. Click on `Assets` to show the files available in the release and then download the .exe installer. - -We hope to have an updated version in February 2021 with the new DirectShow driver. +To install the Video Conference mute, please use the [v0.36 experimental version of PowerToys][github-prerelease-link] to try out this version. It includes all improvements from v0.35 in addition to the Video conference utility. Click on `Assets` to show the files available in the release and then download the .exe installer. ### Via WinGet (Preview) Download PowerToys from [WinGet](https://github.com/microsoft/winget-cli#installing-the-client). To install PowerToys, run the following command from the command line / PowerShell: @@ -78,7 +76,9 @@ Our [prioritized roadmap][roadmap] of features and utilities that the core team ### 0.35 - March 2021 Update -Our goals for the [v0.35 release cycle][github-release-link] were to add in new functionality to support quick swapping layouts for FancyZones, wrap up work for the DirectShow migration for Video Conference Mute so we can migrate into the main dev branch as well as fixing bugs. The 0.36 experimental release will happen the week of April 5th toward the end of the week pending testing. Throughout these efforts, we continue working towards stability across all PowerToys utilities. +Our goals for the [v0.35 release cycle][github-release-link] were to add in new functionality to support quick swapping layouts for FancyZones, wrap up work for the DirectShow migration for Video Conference Mute so we can migrate into the main dev branch as well as fixing bugs. + +The 0.36 experimental release was released as well which includes Video Conference Mute. Our [prioritized roadmap][roadmap] of features and utilities will dictate what the core team is focusing on for the near future. @@ -166,4 +166,4 @@ The application logs basic telemetry. Our Telemetry Data page (Coming Soon) has [github-next-release-work]: https://github.com/microsoft/PowerToys/issues?q=is%3Aopen+is%3Aissue+project%3Amicrosoft%2FPowerToys%2F19 -[github-prerelease-link]: https://github.com/microsoft/PowerToys/releases/tag/v0.28.0 +[github-prerelease-link]: https://github.com/microsoft/PowerToys/releases/tag/v0.36.0 diff --git a/doc/devdocs/modules/launcher/new-plugin-checklist.md b/doc/devdocs/modules/launcher/new-plugin-checklist.md new file mode 100644 index 0000000000..dbf4f99755 --- /dev/null +++ b/doc/devdocs/modules/launcher/new-plugin-checklist.md @@ -0,0 +1,30 @@ +# New plugin checklist +- [ ] The plugin is a project under `modules\launcher\Plugins` +- [ ] Microsoft plugin project name pattern: `Microsoft.PowerToys.Run.Plugin.{PluginName}` +- [ ] Community plugin project name pattern: `Community.PowerToys.Run.Plugin.{PluginName}` +- [ ] [`GlobalSuppressions.cs`](/src/codeAnalysis/GlobalSuppressions.cs) and [`StyleCop.json`](/src/codeAnalysis/StyleCop.json) have to be included in the plugin project so it follows PowerToys code guidelines +- [ ] The plugin has to have `{PowerToys version}.0` version +- [ ] Make sure `*.csproj` specify only x64 platform target +- [ ] The plugin has to contain a `plugin.json` file of the following format in its root folder +``` +{ + "ID": string, // GUID string + "ActionKeyword": string, // Direct activation phrase + "IsGlobal": boolean, + "Name": string, // Has to be unique, same as 'PluginName' in the project name pattern + "Author": string, + "Version": "1.0.0", // For future compatibility + "Language": "csharp", // So far we support only csharp + "Website": "https://aka.ms/powertoys", + "ExecuteFileName": string, // Should be {Type}.PowerToys.Run.Plugin.{PluginName}.dll + "IcoPathDark": string, // Path to dark theme icon. The path is relative to the root plugin folder + "IcoPathLight": string // Path to light theme icon. The path is relative to the root plugin folder +} +``` +- [ ] Do not use plugin name or PowerToys as prefixes for entities inside of the plugin project +- [ ] The plugin has to have Unit tests. Use MSTest framework +- [ ] To enable localization add `LocProject.json` file to the plugin root folder. For details see [`localization.md`](/doc/devdocs/localization.md#enabling-localization-on-a-new-project) +- [ ] Plugin's output code and assets have to be included in the installer [`Product.wxs`](/installer/PowerToysSetup/Product.wxs) +- [ ] Test the plugin with a local build. Build the installer, install, check that the plugin works as expected +- [ ] All plugin's binaries have to be included in the signed build [`pipeline.user.windows.yml`](/.pipelines/pipeline.user.windows.yml) +- [ ] The plugin target framework has to be .NET Core 3.1. All dependencies have to have .NET 5 version diff --git a/installer/PowerToysBootstrapper/bootstrapper/bootstrapper.cpp b/installer/PowerToysBootstrapper/bootstrapper/bootstrapper.cpp index 6e71d4a7fa..144f54abaa 100644 --- a/installer/PowerToysBootstrapper/bootstrapper/bootstrapper.cpp +++ b/installer/PowerToysBootstrapper/bootstrapper/bootstrapper.cpp @@ -136,8 +136,9 @@ int Bootstrapper(HINSTANCE hInstance) options.add_options() ("h,help", "Show help") ("no_full_ui", "Use reduced UI for MSI") - ("s,silent", "Suppress MSI UI and notifications") + ("s,silent", "Suppress all UI, notifications and does not start PowerToys") ("no_start_pt", "Do not launch PowerToys after the installation is complete") + ("start_pt", "Always launch PowerToys after the installation is complete") ("skip_dotnet_install", "Skip dotnet 3.X installation even if it's not detected") ("log_level", "Log level. Possible values: off|debug|error", cxxopts::value()->default_value("off")) ("log_dir", "Log directory", cxxopts::value()->default_value(".")) @@ -169,10 +170,11 @@ int Bootstrapper(HINSTANCE hInstance) const bool noFullUI = cmdArgs["no_full_ui"].as(); const bool skipDotnetInstall = cmdArgs["skip_dotnet_install"].as(); const bool noStartPT = cmdArgs["no_start_pt"].as(); + const bool startPT = cmdArgs["start_pt"].as(); const auto logLevel = cmdArgs["log_level"].as(); const auto logDirArg = cmdArgs["log_dir"].as(); const auto installDirArg = cmdArgs["install_dir"].as(); - const bool extract_msi_only = cmdArgs["extract_msi"].as(); + const bool extractMsiOnly = cmdArgs["extract_msi"].as(); std::wstring installFolderProp; if (!installDirArg.empty()) @@ -216,7 +218,7 @@ int Bootstrapper(HINSTANCE hInstance) } SetupLogger(logDir, severity); - spdlog::debug("PowerToys Bootstrapper is launched\nnoFullUI: {}\nsilent: {}\nno_start_pt: {}\nskip_dotnet_install: {}\nlog_level: {}\ninstall_dir: {}\nextract_msi: {}\n", noFullUI, g_Silent, noStartPT, skipDotnetInstall, logLevel, installDirArg, extract_msi_only); + spdlog::debug("PowerToys Bootstrapper is launched\nnoFullUI: {}\nsilent: {}\nno_start_pt: {}\nskip_dotnet_install: {}\nlog_level: {}\ninstall_dir: {}\nextract_msi: {}\n", noFullUI, g_Silent, noStartPT, skipDotnetInstall, logLevel, installDirArg, extractMsiOnly); const VersionHelper myVersion(VERSION_MAJOR, VERSION_MINOR, VERSION_REVISION); @@ -229,7 +231,7 @@ int Bootstrapper(HINSTANCE hInstance) } // If a user requested an MSI -> extract it and exit - if (extract_msi_only) + if (extractMsiOnly) { if (const auto installerPath = ExtractEmbeddedInstaller(fs::current_path())) { @@ -402,8 +404,6 @@ int Bootstrapper(HINSTANCE hInstance) ShowMessageBoxError(IDS_DOTNET_INSTALL_ERROR); } - CleanupSettingsFromOlderVersions(); - // At this point, there's no reason to show progress bar window, since MSI installers have their own CloseProgressBarDialog(); @@ -418,7 +418,7 @@ int Bootstrapper(HINSTANCE hInstance) spdlog::debug("Installation completed"); - if (!noStartPT && !g_Silent) + if ((!noStartPT && !g_Silent) || startPT) { spdlog::debug("Starting the newly installed PowerToys.exe"); auto newPTPath = updating::get_msi_package_installed_path(); diff --git a/installer/PowerToysSetup/Product.wxs b/installer/PowerToysSetup/Product.wxs index 2ea9c9fe76..84690b52c7 100644 --- a/installer/PowerToysSetup/Product.wxs +++ b/installer/PowerToysSetup/Product.wxs @@ -35,8 +35,8 @@ - - = 17134)]]> + + = 18362)]]> @@ -642,7 +642,7 @@ - + diff --git a/src/common/interop/PowerToysInterop.vcxproj b/src/common/interop/PowerToysInterop.vcxproj index c5c59fe29c..e395437c28 100644 --- a/src/common/interop/PowerToysInterop.vcxproj +++ b/src/common/interop/PowerToysInterop.vcxproj @@ -87,6 +87,7 @@ + diff --git a/src/common/interop/PowerToysInterop.vcxproj.filters b/src/common/interop/PowerToysInterop.vcxproj.filters index c68a2dff76..1a88f7682e 100644 --- a/src/common/interop/PowerToysInterop.vcxproj.filters +++ b/src/common/interop/PowerToysInterop.vcxproj.filters @@ -27,6 +27,9 @@ Header Files + + Header Files + diff --git a/src/common/interop/interop-tests/InteropTests.cs b/src/common/interop/interop-tests/InteropTests.cs index 3e71c09c58..aa01689c42 100644 --- a/src/common/interop/interop-tests/InteropTests.cs +++ b/src/common/interop/interop-tests/InteropTests.cs @@ -22,9 +22,6 @@ namespace Microsoft.Interop.Tests [TestInitialize] public void Initialize() { - // Make sure we don't crash - Assert.IsTrue(CommonManaged.ShouldNewSettingsBeUsed() == CommonManaged.ShouldNewSettingsBeUsed()); - ClientPipe = new TwoWayPipeMessageIPCManaged(ClientSidePipe, ServerSidePipe, null); } diff --git a/src/common/interop/interop.cpp b/src/common/interop/interop.cpp index b54239489e..bcf191401d 100644 --- a/src/common/interop/interop.cpp +++ b/src/common/interop/interop.cpp @@ -122,11 +122,6 @@ public static String ^ GetProductVersion() { return gcnew String(get_product_version().c_str()); } - - static bool ShouldNewSettingsBeUsed() - { - return UseNewSettings(); - } }; public @@ -160,5 +155,9 @@ public static String ^ ShowShortcutGuideSharedEvent() { return gcnew String(CommonSharedConstants::SHOW_SHORTCUT_GUIDE_SHARED_EVENT); } + + static String ^ KeyboardManagerConfigFileMutexName() { + return gcnew String(CommonSharedConstants::KEYBOARD_MANAGER_CONFIG_FILE_MUTEX_NAME); + } }; } diff --git a/src/common/interop/shared_constants.h b/src/common/interop/shared_constants.h index da719abf06..3895d2ebd3 100644 --- a/src/common/interop/shared_constants.h +++ b/src/common/interop/shared_constants.h @@ -27,4 +27,7 @@ namespace CommonSharedConstants // Max DWORD for key code to disable keys. const int VK_DISABLED = 0x100; -} \ No newline at end of file + + // Name of the mutex which controls access to the configuration file for Keyboard Manager + const wchar_t KEYBOARD_MANAGER_CONFIG_FILE_MUTEX_NAME[] = L"Local\\PowerToys_KeyboardManager_ConfigFileMutex"; +} diff --git a/src/common/updating/updating.cpp b/src/common/updating/updating.cpp index 50fc765896..2c478ae582 100644 --- a/src/common/updating/updating.cpp +++ b/src/common/updating/updating.cpp @@ -10,7 +10,6 @@ #include #include #include -#include namespace // Strings in this namespace should not be localized { @@ -77,9 +76,6 @@ namespace updating const VersionHelper current_version(VERSION_MAJOR, VERSION_MINOR, VERSION_REVISION); VersionHelper github_version = current_version; - // On a <1903 system, block updates to 0.36+ - const bool blockNonPatchReleases = current_version.major == 0 && current_version.minor == 35 && !Is19H1OrHigher(); - if (prerelease) { const auto body = co_await client.request(Uri{ ALL_RELEASES_ENDPOINT }); @@ -108,11 +104,6 @@ namespace updating } } - if (blockNonPatchReleases && github_version >= VersionHelper{ 0, 36, 0 }) - { - co_return version_up_to_date{}; - } - if (github_version <= current_version) { co_return version_up_to_date{}; diff --git a/src/common/utils/appMutex.h b/src/common/utils/appMutex.h index 61db26f144..34a334ff05 100644 --- a/src/common/utils/appMutex.h +++ b/src/common/utils/appMutex.h @@ -10,17 +10,13 @@ namespace { - constexpr inline wchar_t POWERTOYS_MSI_MUTEX_NAME[] = L"Local\\PowerToyRunMutex"; - constexpr inline wchar_t POWERTOYS_MSIX_MUTEX_NAME[] = L"Local\\PowerToyMSIXRunMutex"; - constexpr inline wchar_t POWERTOYS_BOOTSTRAPPER_MUTEX_NAME[] = L"PowerToysBootstrapperMutex"; + constexpr inline wchar_t POWERTOYS_MSI_MUTEX_NAME[] = L"Local\\PowerToys_Runner_MSI_InstanceMutex"; + constexpr inline wchar_t POWERTOYS_MSIX_MUTEX_NAME[] = L"Local\\PowerToys_Runner_MSIX_InstanceMutex"; + constexpr inline wchar_t POWERTOYS_BOOTSTRAPPER_MUTEX_NAME[] = L"Local\\PowerToys_Bootstrapper_InstanceMutex"; } -inline wil::unique_mutex_nothrow createAppMutex(std::wstring mutexName) +inline wil::unique_mutex_nothrow createAppMutex(const std::wstring& mutexName) { - wchar_t username[UNLEN + 1]; - DWORD username_length = UNLEN + 1; - GetUserNameW(username, &username_length); - mutexName += username; wil::unique_mutex_nothrow result{ CreateMutexW(nullptr, TRUE, mutexName.c_str()) }; return GetLastError() == ERROR_ALREADY_EXISTS ? wil::unique_mutex_nothrow{} : std::move(result); diff --git a/src/common/utils/logger_helper.h b/src/common/utils/logger_helper.h index 852b6d9816..4d9699224a 100644 --- a/src/common/utils/logger_helper.h +++ b/src/common/utils/logger_helper.h @@ -28,13 +28,40 @@ namespace LoggerHelpers return false; } + inline bool dir_exists(std::filesystem::path dir) + { + std::error_code err; + auto entry = std::filesystem::directory_entry(dir, err); + if (err.value()) + { + Logger::error("Failed to create directory entry. {}", err.message()); + return false; + } + + return entry.exists(); + } + inline bool delete_other_versions_log_folders(std::wstring_view appPath, const std::filesystem::path& currentVersionLogFolder) { bool result = true; std::filesystem::path logFolderPath(appPath); logFolderPath.append(LogSettings::logPath); - for (const auto& dir : std::filesystem::directory_iterator(logFolderPath)) + if (!dir_exists(logFolderPath)) + { + Logger::trace("Directory {} does not exist", logFolderPath.string()); + return true; + } + + std::error_code err; + auto folders = std::filesystem::directory_iterator(logFolderPath, err); + if (err.value()) + { + Logger::error("Failed to create directory iterator for {}. {}", logFolderPath.string(), err.message()); + return false; + } + + for (const auto& dir : folders) { if (dir != currentVersionLogFolder) { diff --git a/src/modules/colorPicker/ColorPicker/dllmain.cpp b/src/modules/colorPicker/ColorPicker/dllmain.cpp index 68f1628b6b..73a58ae1a7 100644 --- a/src/modules/colorPicker/ColorPicker/dllmain.cpp +++ b/src/modules/colorPicker/ColorPicker/dllmain.cpp @@ -6,7 +6,6 @@ #include "Generated Files/resource.h" #include #include -#include #include #include @@ -227,12 +226,8 @@ public: { ResetEvent(send_telemetry_event); ResetEvent(m_hInvokeEvent); - // use only with new settings? - if (UseNewSettings()) - { - launch_process(); - m_enabled = true; - } + launch_process(); + m_enabled = true; }; virtual void disable() diff --git a/src/modules/colorPicker/ColorPickerUI/Helpers/AppStateHandler.cs b/src/modules/colorPicker/ColorPickerUI/Helpers/AppStateHandler.cs index 2b303cb663..236c4fbfb0 100644 --- a/src/modules/colorPicker/ColorPickerUI/Helpers/AppStateHandler.cs +++ b/src/modules/colorPicker/ColorPickerUI/Helpers/AppStateHandler.cs @@ -54,7 +54,7 @@ namespace ColorPicker.Helpers } } - public void EndUserSession() + public bool EndUserSession() { lock (_colorPickerVisibilityLock) { @@ -70,7 +70,11 @@ namespace ColorPicker.Helpers } SessionEventHelper.End(); + + return true; } + + return false; } } diff --git a/src/modules/colorPicker/ColorPickerUI/Keyboard/KeyboardMonitor.cs b/src/modules/colorPicker/ColorPickerUI/Keyboard/KeyboardMonitor.cs index f18f9acb02..d96b1c49c7 100644 --- a/src/modules/colorPicker/ColorPickerUI/Keyboard/KeyboardMonitor.cs +++ b/src/modules/colorPicker/ColorPickerUI/Keyboard/KeyboardMonitor.cs @@ -72,7 +72,7 @@ namespace ColorPicker.Keyboard // ESC pressed if (virtualCode == KeyInterop.VirtualKeyFromKey(Key.Escape)) { - _appStateHandler.EndUserSession(); + e.Handled = _appStateHandler.EndUserSession(); return; } diff --git a/src/modules/fancyzones/editor/FancyZonesEditor/FancyZonesEditor.csproj b/src/modules/fancyzones/editor/FancyZonesEditor/FancyZonesEditor.csproj index 612e95b12f..c8aa6c63e4 100644 --- a/src/modules/fancyzones/editor/FancyZonesEditor/FancyZonesEditor.csproj +++ b/src/modules/fancyzones/editor/FancyZonesEditor/FancyZonesEditor.csproj @@ -65,13 +65,13 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/modules/fancyzones/editor/FancyZonesEditor/MainWindow.xaml b/src/modules/fancyzones/editor/FancyZonesEditor/MainWindow.xaml index 8636c438a2..5d1228ae74 100644 --- a/src/modules/fancyzones/editor/FancyZonesEditor/MainWindow.xaml +++ b/src/modules/fancyzones/editor/FancyZonesEditor/MainWindow.xaml @@ -2,16 +2,16 @@ x:Name="MainWindow1" AutomationProperties.Name="{x:Static props:Resources.Fancy_Zones_Main_Editor}" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:ui="http://schemas.modernwpf.com/2019" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:FancyZonesEditor" xmlns:Converters="clr-namespace:FancyZonesEditor.Converters" xmlns:props="clr-namespace:FancyZonesEditor.Properties" xmlns:local1="clr-namespace:FancyZonesEditor.ViewModels" - xmlns:ui="http://schemas.modernwpf.com/2019" - xmlns:i="http://schemas.microsoft.com/xaml/behaviors" xmlns:controls="clr-namespace:ModernWpf.Controls;assembly=ModernWpf" + xmlns:sys="clr-namespace:System;assembly=mscorlib" mc:Ignorable="d" Title="FancyZones Editor" ui:WindowHelper.UseModernWindowStyle="True" @@ -84,18 +84,17 @@ - - - - + + + + + - + @@ -232,6 +234,7 @@ + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + VerticalAlignment="Center" + Height="36" + Width="36" + Padding="0" + BorderBrush="Transparent" + Click="EditZones_Click" + Visibility="{Binding Path=Type, Converter={StaticResource LayoutTypeCustomToVisibilityConverter}}" + ToolTip="{x:Static props:Resources.Edit_zones}" + AutomationProperties.Name="{x:Static props:Resources.Edit_zones}" + Style="{StaticResource AccentButtonStyle}" + ui:ControlHelper.CornerRadius="36"> + - + - - - - - - + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + + + + + + + diff --git a/src/modules/fancyzones/editor/FancyZonesEditor/MainWindow.xaml.cs b/src/modules/fancyzones/editor/FancyZonesEditor/MainWindow.xaml.cs index dbff7e317d..8707ec2de3 100644 --- a/src/modules/fancyzones/editor/FancyZonesEditor/MainWindow.xaml.cs +++ b/src/modules/fancyzones/editor/FancyZonesEditor/MainWindow.xaml.cs @@ -421,5 +421,14 @@ namespace FancyZonesEditor { _openedDialog = null; } + + private void EditDialogNumberBox_KeyDown(object sender, KeyEventArgs e) + { + // Making sure that pressing Enter when changing values in a NumberBox will not close the edit dialog. + if (e.Key == Key.Enter) + { + e.Handled = true; + } + } } } diff --git a/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.Designer.cs b/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.Designer.cs index b0ed1cb6a0..4b22245ef7 100644 --- a/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.Designer.cs +++ b/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.Designer.cs @@ -250,7 +250,7 @@ namespace FancyZonesEditor.Properties { } /// - /// Looks up a localized string similar to Distance to highlight adjacent zones. + /// Looks up a localized string similar to Highlight distance. /// public static string Distance_adjacent_zones { get { @@ -537,6 +537,15 @@ namespace FancyZonesEditor.Properties { } } + /// + /// Looks up a localized string similar to Number of zones. + /// + public static string Number_of_zones { + get { + return ResourceManager.GetString("Number_of_zones", resourceCulture); + } + } + /// /// Looks up a localized string similar to Number of zones. /// @@ -546,6 +555,15 @@ namespace FancyZonesEditor.Properties { } } + /// + /// Looks up a localized string similar to px. + /// + public static string Pixels { + get { + return ResourceManager.GetString("Pixels", resourceCulture); + } + } + /// /// Looks up a localized string similar to None. /// @@ -556,11 +574,20 @@ namespace FancyZonesEditor.Properties { } /// - /// Looks up a localized string similar to Select a key to quickly apply the layout (Win + Ctrl + Alt + key). + /// Looks up a localized string similar to Press Win + Ctrl + Alt + selected key to apply this layout. /// - public static string QuickKey_Select { + public static string QuickKey_Description { get { - return ResourceManager.GetString("QuickKey_Select", resourceCulture); + return ResourceManager.GetString("QuickKey_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Layout shortcut. + /// + public static string QuickKey_Title { + get { + return ResourceManager.GetString("QuickKey_Title", resourceCulture); } } diff --git a/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.resx b/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.resx index 58809d5097..d53e745267 100644 --- a/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.resx +++ b/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.resx @@ -145,7 +145,8 @@ Custom layout creator - Distance to highlight adjacent zones + Highlight distance + Distance of when an adjacent zone should light up when the window is close to it Edit layout @@ -343,10 +344,20 @@ Splitter: Title for concept: A segmenter visual for splitting one item into two. This would be the vertical line - - Select a key to quickly apply the layout (Win + Ctrl + Alt + key) + + Press Win + Ctrl + Alt + selected key to apply this layout None + + Number of zones + + + px + Abbreviation of pixels + + + Layout shortcut + \ No newline at end of file diff --git a/src/modules/fancyzones/editor/FancyZonesEditor/Styles/ButtonStyles.xaml b/src/modules/fancyzones/editor/FancyZonesEditor/Styles/ButtonStyles.xaml index c6cac96dbc..45b606d91e 100644 --- a/src/modules/fancyzones/editor/FancyZonesEditor/Styles/ButtonStyles.xaml +++ b/src/modules/fancyzones/editor/FancyZonesEditor/Styles/ButtonStyles.xaml @@ -16,7 +16,7 @@ - + diff --git a/src/modules/fancyzones/editor/FancyZonesEditor/loc/es/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.resx.lcl b/src/modules/fancyzones/editor/FancyZonesEditor/loc/es/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.resx.lcl index 8680fc04d6..a354e20813 100644 --- a/src/modules/fancyzones/editor/FancyZonesEditor/loc/es/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.resx.lcl +++ b/src/modules/fancyzones/editor/FancyZonesEditor/loc/es/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.resx.lcl @@ -334,11 +334,11 @@ - + - + - + @@ -352,15 +352,6 @@ - - - - - - - - - diff --git a/src/modules/fancyzones/editor/FancyZonesEditor/loc/fr/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.resx.lcl b/src/modules/fancyzones/editor/FancyZonesEditor/loc/fr/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.resx.lcl index 32c2335c22..50f44cd345 100644 --- a/src/modules/fancyzones/editor/FancyZonesEditor/loc/fr/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.resx.lcl +++ b/src/modules/fancyzones/editor/FancyZonesEditor/loc/fr/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.resx.lcl @@ -334,11 +334,11 @@ - + - + - + @@ -352,15 +352,6 @@ - - - - - - - - - diff --git a/src/modules/fancyzones/editor/FancyZonesEditor/loc/pt-BR/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.resx.lcl b/src/modules/fancyzones/editor/FancyZonesEditor/loc/pt-BR/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.resx.lcl index 71bc02a4f5..180a00f1ac 100644 --- a/src/modules/fancyzones/editor/FancyZonesEditor/loc/pt-BR/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.resx.lcl +++ b/src/modules/fancyzones/editor/FancyZonesEditor/loc/pt-BR/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.resx.lcl @@ -334,11 +334,11 @@ - + - + - + @@ -352,15 +352,6 @@ - - - - - - - - - diff --git a/src/modules/fancyzones/editor/FancyZonesEditor/loc/pt-PT/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.resx.lcl b/src/modules/fancyzones/editor/FancyZonesEditor/loc/pt-PT/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.resx.lcl index cb298d739e..0b14b5bb62 100644 --- a/src/modules/fancyzones/editor/FancyZonesEditor/loc/pt-PT/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.resx.lcl +++ b/src/modules/fancyzones/editor/FancyZonesEditor/loc/pt-PT/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.resx.lcl @@ -334,11 +334,11 @@ - + - + - + @@ -352,15 +352,6 @@ - - - - - - - - - diff --git a/src/modules/fancyzones/editor/FancyZonesEditor/loc/tr/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.resx.lcl b/src/modules/fancyzones/editor/FancyZonesEditor/loc/tr/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.resx.lcl index 1918f3e91e..1599e66c84 100644 --- a/src/modules/fancyzones/editor/FancyZonesEditor/loc/tr/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.resx.lcl +++ b/src/modules/fancyzones/editor/FancyZonesEditor/loc/tr/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.resx.lcl @@ -334,11 +334,11 @@ - + - + - + @@ -352,15 +352,6 @@ - - - - - - - - - diff --git a/src/modules/fancyzones/lib/Settings.h b/src/modules/fancyzones/lib/Settings.h index 03a1df5899..ef085e1221 100644 --- a/src/modules/fancyzones/lib/Settings.h +++ b/src/modules/fancyzones/lib/Settings.h @@ -12,6 +12,7 @@ namespace ZonedWindowProperties const wchar_t MultiMonitorDeviceID[] = L"FancyZones#MultiMonitorDevice"; } +// in reality, this file needs to be kept in sync currently with src/settings-ui/Microsoft.PowerToys.Settings.UI.Library/FZConfigProperties.cs struct Settings { enum struct OverlappingZonesAlgorithm : int @@ -45,7 +46,7 @@ struct Settings std::wstring zoneHighlightColor = L"#008CFF"; int zoneHighlightOpacity = 50; OverlappingZonesAlgorithm overlappingZonesAlgorithm = OverlappingZonesAlgorithm::Smallest; - PowerToysSettings::HotkeyObject editorHotkey = PowerToysSettings::HotkeyObject::from_settings(true, false, false, false, VK_OEM_3); + PowerToysSettings::HotkeyObject editorHotkey = PowerToysSettings::HotkeyObject::from_settings(true, false, false, true, VK_OEM_3); std::wstring excludedApps = L""; std::vector excludedAppsArray; }; diff --git a/src/modules/imageresizer/ui/Models/AdvancedSettings.cs b/src/modules/imageresizer/ui/Models/AdvancedSettings.cs deleted file mode 100644 index 3ae4eaa0cc..0000000000 --- a/src/modules/imageresizer/ui/Models/AdvancedSettings.cs +++ /dev/null @@ -1,12 +0,0 @@ -// This class sets the visibility property of Advanced settings based on the OS Version - -namespace ImageResizer.Models -{ - public static class AdvancedSettings - { - public static bool UseNewSettings() - { - return interop.CommonManaged.ShouldNewSettingsBeUsed(); - } - } -} diff --git a/src/modules/imageresizer/ui/Properties/Resources.Designer.cs b/src/modules/imageresizer/ui/Properties/Resources.Designer.cs index e4365ccf75..4acfe2ecbb 100644 --- a/src/modules/imageresizer/ui/Properties/Resources.Designer.cs +++ b/src/modules/imageresizer/ui/Properties/Resources.Designer.cs @@ -59,232 +59,7 @@ namespace ImageResizer.Properties { resourceCulture = value; } } - - /// - /// Looks up a localized string similar to About. - /// - public static string Advanced_About { - get { - return ResourceManager.GetString("Advanced_About", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Create a new size. - /// - public static string Advanced_CreateSize { - get { - return ResourceManager.GetString("Advanced_CreateSize", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Delete. - /// - public static string Advanced_DeleteSize { - get { - return ResourceManager.GetString("Advanced_DeleteSize", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Encoding. - /// - public static string Advanced_Encoding { - get { - return ResourceManager.GetString("Advanced_Encoding", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to _Fallback encoder:. - /// - public static string Advanced_FallbackEncoder { - get { - return ResourceManager.GetString("Advanced_FallbackEncoder", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Fallback encoder. - /// - public static string Advanced_FallbackEncoder_Name { - get { - return ResourceManager.GetString("Advanced_FallbackEncoder_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to File. - /// - public static string Advanced_File { - get { - return ResourceManager.GetString("Advanced_File", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to _Filename:. - /// - public static string Advanced_FileName { - get { - return ResourceManager.GetString("Advanced_FileName", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Filename. - /// - public static string Advanced_FileName_Name { - get { - return ResourceManager.GetString("Advanced_FileName_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Original filename. - /// - public static string Advanced_FileNameToken1 { - get { - return ResourceManager.GetString("Advanced_FileNameToken1", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Size name. - /// - public static string Advanced_FileNameToken2 { - get { - return ResourceManager.GetString("Advanced_FileNameToken2", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Selected width. - /// - public static string Advanced_FileNameToken3 { - get { - return ResourceManager.GetString("Advanced_FileNameToken3", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Selected height. - /// - public static string Advanced_FileNameToken4 { - get { - return ResourceManager.GetString("Advanced_FileNameToken4", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Actual width (pixels). - /// - public static string Advanced_FileNameToken5 { - get { - return ResourceManager.GetString("Advanced_FileNameToken5", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Actual height (pixels). - /// - public static string Advanced_FileNameToken6 { - get { - return ResourceManager.GetString("Advanced_FileNameToken6", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The following parameters can be used.. - /// - public static string Advanced_FileNameTokens { - get { - return ResourceManager.GetString("Advanced_FileNameTokens", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to _JPEG quality level:. - /// - public static string Advanced_JpegQualityLevel { - get { - return ResourceManager.GetString("Advanced_JpegQualityLevel", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to JPEG quality level. - /// - public static string Advanced_JpegQualityLevel_Name { - get { - return ResourceManager.GetString("Advanced_JpegQualityLevel_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to _Use original date modified. - /// - public static string Advanced_KeepDateModified { - get { - return ResourceManager.GetString("Advanced_KeepDateModified", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to _PNG interlacing:. - /// - public static string Advanced_PngInterlaceOption { - get { - return ResourceManager.GetString("Advanced_PngInterlaceOption", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to PNG interlacing. - /// - public static string Advanced_PngInterlaceOption_Name { - get { - return ResourceManager.GetString("Advanced_PngInterlaceOption_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Sizes. - /// - public static string Advanced_Sizes { - get { - return ResourceManager.GetString("Advanced_Sizes", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to _TIFF compression:. - /// - public static string Advanced_TiffCompressOption { - get { - return ResourceManager.GetString("Advanced_TiffCompressOption", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to TIFF compression. - /// - public static string Advanced_TiffCompressOption_Name { - get { - return ResourceManager.GetString("Advanced_TiffCompressOption_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Settings. - /// - public static string Advanced_Title { - get { - return ResourceManager.GetString("Advanced_Title", resourceCulture); - } - } - + /// /// Looks up a localized string similar to All Files. /// @@ -302,16 +77,7 @@ namespace ImageResizer.Properties { return ResourceManager.GetString("Cancel", resourceCulture); } } - - /// - /// Looks up a localized string similar to © 2020 Brice Lambson. All rights reserved.. - /// - public static string Copyright { - get { - return ResourceManager.GetString("Copyright", resourceCulture); - } - } - + /// /// Looks up a localized string similar to Height. /// @@ -384,15 +150,6 @@ namespace ImageResizer.Properties { } } - /// - /// Looks up a localized string similar to Settings. - /// - public static string Input_ShowAdvanced { - get { - return ResourceManager.GetString("Input_ShowAdvanced", resourceCulture); - } - } - /// /// Looks up a localized string similar to _Make pictures smaller but not larger. /// @@ -726,69 +483,6 @@ namespace ImageResizer.Properties { } } - /// - /// Looks up a localized string similar to CCITT3. - /// - public static string TiffCompressOption_Ccitt3 { - get { - return ResourceManager.GetString("TiffCompressOption_Ccitt3", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to CCITT4. - /// - public static string TiffCompressOption_Ccitt4 { - get { - return ResourceManager.GetString("TiffCompressOption_Ccitt4", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to (Default). - /// - public static string TiffCompressOption_Default { - get { - return ResourceManager.GetString("TiffCompressOption_Default", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to LZW. - /// - public static string TiffCompressOption_Lzw { - get { - return ResourceManager.GetString("TiffCompressOption_Lzw", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to None. - /// - public static string TiffCompressOption_None { - get { - return ResourceManager.GetString("TiffCompressOption_None", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to RLE. - /// - public static string TiffCompressOption_Rle { - get { - return ResourceManager.GetString("TiffCompressOption_Rle", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to ZIP. - /// - public static string TiffCompressOption_Zip { - get { - return ResourceManager.GetString("TiffCompressOption_Zip", resourceCulture); - } - } - /// /// Looks up a localized string similar to Times Symbol. /// diff --git a/src/modules/imageresizer/ui/Properties/Resources.resx b/src/modules/imageresizer/ui/Properties/Resources.resx index c6dfcc01ac..1f168cf9fa 100644 --- a/src/modules/imageresizer/ui/Properties/Resources.resx +++ b/src/modules/imageresizer/ui/Properties/Resources.resx @@ -117,93 +117,12 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - About - - - Create a new size - - - Delete - remove a file - - - Encoding - encoding a file to a different format - - - _Fallback encoder: - - - Fallback encoder - - - File - as in file name - - - _Filename: - - - Original filename - - - Size name - - - Selected width - - - Selected height - - - Actual width (pixels) - - - Actual height (pixels) - - - The following parameters can be used. - - - Filename - - - _JPEG quality level: - - - JPEG quality level - - - _Use original date modified - - - _PNG interlacing: - - - PNG interlacing - - - Sizes - - - _TIFF compression: - - - TIFF compression - - - Settings - All Files Cancel - - © 2020 Brice Lambson. All rights reserved. - Height @@ -229,9 +148,6 @@ Resize - - Settings - _Make pictures smaller but not larger @@ -343,32 +259,6 @@ Small - - CCITT3 - Do not loc - - - CCITT4 - Do not loc - - - (Default) - - - LZW - Do not loc - - - None - - - RLE - Do not loc - - - ZIP - Do not loc - Times Symbol diff --git a/src/modules/imageresizer/ui/ViewModels/InputViewModel.cs b/src/modules/imageresizer/ui/ViewModels/InputViewModel.cs index 6913e67867..c96f34b887 100644 --- a/src/modules/imageresizer/ui/ViewModels/InputViewModel.cs +++ b/src/modules/imageresizer/ui/ViewModels/InputViewModel.cs @@ -1,7 +1,6 @@ // Copyright (c) Brice Lambson // The Brice Lambson licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. Code forked from Brice Lambson's https://github.com/bricelam/ImageResizer/ -// ShowAdvancedCommand = new RelayCommand(ShowAdvanced); using System.Windows.Input; using ImageResizer.Helpers; @@ -35,21 +34,14 @@ namespace ImageResizer.ViewModels ResizeCommand = new RelayCommand(Resize); CancelCommand = new RelayCommand(Cancel); - ShowAdvancedCommand = new RelayCommand(ShowAdvanced); - - ShowAdvancedSettings = !AdvancedSettings.UseNewSettings(); } - public bool ShowAdvancedSettings { get; } - public Settings Settings { get; } public ICommand ResizeCommand { get; } public ICommand CancelCommand { get; } - public ICommand ShowAdvancedCommand { get; } - public void Resize() { Settings.Save(); @@ -58,8 +50,5 @@ namespace ImageResizer.ViewModels public void Cancel() => _mainView.Close(); - - public void ShowAdvanced() - => _mainView.ShowAdvanced(new AdvancedViewModel(Settings)); } } diff --git a/src/modules/imageresizer/ui/Views/AccessibleHyperlink.cs b/src/modules/imageresizer/ui/Views/AccessibleHyperlink.cs deleted file mode 100644 index c50ac57ffe..0000000000 --- a/src/modules/imageresizer/ui/Views/AccessibleHyperlink.cs +++ /dev/null @@ -1,24 +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 System.Collections.Generic; -using System.Windows; -using System.Windows.Automation.Peers; -using System.Windows.Documents; - -namespace ImageResizer.Views -{ - public class AccessibleHyperlink : Hyperlink - { - public AutomationControlType ControlType { get; set; } - - protected override AutomationPeer OnCreateAutomationPeer() - { - var peer = new CustomizableHyperlinkAutomationPeer(this); - - peer.ControlType = ControlType; - return peer; - } - } -} diff --git a/src/modules/imageresizer/ui/Views/AdvancedWindow.xaml b/src/modules/imageresizer/ui/Views/AdvancedWindow.xaml deleted file mode 100644 index d43c40b1e7..0000000000 --- a/src/modules/imageresizer/ui/Views/AdvancedWindow.xaml +++ /dev/null @@ -1,312 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -