diff --git a/.configurations/configuration.dsc.yaml b/.configurations/configuration.dsc.yaml index 4649f8d3ea..a6256da512 100644 --- a/.configurations/configuration.dsc.yaml +++ b/.configurations/configuration.dsc.yaml @@ -11,7 +11,7 @@ properties: - resource: Microsoft.WinGet.DSC/WinGetPackage id: vsPackage directives: - description: Install Visual Studio 2022 (any edition is OK) + description: Install Visual Studio 2022 Community (Any edition will work) allowPrerelease: true settings: id: Microsoft.VisualStudio.2022.Community @@ -31,4 +31,4 @@ properties: # Next steps: # Open a terminal # Navigate to the folder you cloned PowerToys to. - # Run git submodule update --init --recursive \ No newline at end of file + # Run git submodule update --init --recursive diff --git a/.configurations/configuration.vsEnterprise.dsc.yaml b/.configurations/configuration.vsEnterprise.dsc.yaml new file mode 100644 index 0000000000..34d73f4975 --- /dev/null +++ b/.configurations/configuration.vsEnterprise.dsc.yaml @@ -0,0 +1,34 @@ +# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 +# Reference: https://github.com/microsoft/PowerToys/blob/main/doc/devdocs/readme.md#compiling-powertoys +properties: + resources: + - resource: Microsoft.Windows.Developer/DeveloperMode + directives: + description: Enable Developer Mode + allowPrerelease: true + settings: + Ensure: Present + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: vsPackage + directives: + description: Install Visual Studio 2022 Enterprise (Any edition will work) + allowPrerelease: true + settings: + id: Microsoft.VisualStudio.2022.Enterprise + source: winget + - resource: Microsoft.VisualStudio.DSC/VSComponents + dependsOn: + - vsPackage + directives: + description: Install required VS workloads + allowPrerelease: true + settings: + productId: Microsoft.VisualStudio.Product.Enterprise + channelId: VisualStudio.17.Release + vsConfigFile: '${WinGetConfigRoot}\..\.vsconfig' + configurationVersion: 0.2.0 + + # Next steps: + # Open a terminal + # Navigate to the folder you cloned PowerToys to. + # Run git submodule update --init --recursive diff --git a/.configurations/configuration.vsProfessional.dsc.yaml b/.configurations/configuration.vsProfessional.dsc.yaml new file mode 100644 index 0000000000..3c08d05856 --- /dev/null +++ b/.configurations/configuration.vsProfessional.dsc.yaml @@ -0,0 +1,34 @@ +# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 +# Reference: https://github.com/microsoft/PowerToys/blob/main/doc/devdocs/readme.md#compiling-powertoys +properties: + resources: + - resource: Microsoft.Windows.Developer/DeveloperMode + directives: + description: Enable Developer Mode + allowPrerelease: true + settings: + Ensure: Present + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: vsPackage + directives: + description: Install Visual Studio 2022 Professional (Any edition will work) + allowPrerelease: true + settings: + id: Microsoft.VisualStudio.2022.Professional + source: winget + - resource: Microsoft.VisualStudio.DSC/VSComponents + dependsOn: + - vsPackage + directives: + description: Install required VS workloads + allowPrerelease: true + settings: + productId: Microsoft.VisualStudio.Product.Professional + channelId: VisualStudio.17.Release + vsConfigFile: '${WinGetConfigRoot}\..\.vsconfig' + configurationVersion: 0.2.0 + + # Next steps: + # Open a terminal + # Navigate to the folder you cloned PowerToys to. + # Run git submodule update --init --recursive diff --git a/.github/actions/spell-check/expect.txt b/.github/actions/spell-check/expect.txt index 8ff1469510..1de314b0f0 100644 --- a/.github/actions/spell-check/expect.txt +++ b/.github/actions/spell-check/expect.txt @@ -367,6 +367,7 @@ DUMMYUNIONNAME dutil DVASPECT DVASPECTINFO +DVD DVH DVHD dvr @@ -422,8 +423,8 @@ EResize ERole ERRORIMAGE ERRORTITLE +erwrite ESettings -esize esrp etl ETW @@ -468,6 +469,7 @@ FILEEXPLORER FILEFLAGS FILEFLAGSMASK FILELOCKSMITH +FILELOCKSMITHCONTEXTMENU FILELOCKSMITHEXT FILELOCKSMITHLIB FILELOCKSMITHLIBINTEROP diff --git a/.pipelines/ESRPSigning_core.json b/.pipelines/ESRPSigning_core.json index 097645b675..0e6a887ec9 100644 --- a/.pipelines/ESRPSigning_core.json +++ b/.pipelines/ESRPSigning_core.json @@ -102,6 +102,8 @@ "WinUI3Apps\\PowerToys.FileLocksmithExt.dll", "WinUI3Apps\\PowerToys.FileLocksmithUI.exe", "WinUI3Apps\\PowerToys.FileLocksmithUI.dll", + "WinUI3Apps\\PowerToys.FileLocksmithContextMenu.dll", + "FileLocksmithContextMenuPackage.msix", "WinUI3Apps\\Peek.Common.dll", "WinUI3Apps\\Peek.FilePreviewer.dll", diff --git a/Directory.Packages.props b/Directory.Packages.props index 32e077ac9a..5074d9e290 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -73,7 +73,7 @@ - + @@ -90,7 +90,7 @@ - + diff --git a/NOTICE.md b/NOTICE.md index 235cff2ad8..5ce46f3b7d 100644 --- a/NOTICE.md +++ b/NOTICE.md @@ -1354,7 +1354,7 @@ EXHIBIT A -Mozilla Public License. - System.Data.SqlClient 4.8.6 - System.Diagnostics.EventLog 8.0.0 - System.Diagnostics.PerformanceCounter 8.0.0 -- System.Drawing.Common 8.0.1 +- System.Drawing.Common 8.0.2 - System.IO.Abstractions 17.2.3 - System.IO.Abstractions.TestingHelpers 17.2.3 - System.Management 8.0.0 @@ -1370,4 +1370,4 @@ EXHIBIT A -Mozilla Public License. - Vanara.PInvoke.Shell32 3.4.11 - Vanara.PInvoke.User32 3.4.11 - WinUIEx 2.2.0 -- WPF-UI 3.0.0-preview.13 +- WPF-UI 3.0.0 diff --git a/PowerToys.sln b/PowerToys.sln index d2b108b6f1..ab6bba5df5 100644 --- a/PowerToys.sln +++ b/PowerToys.sln @@ -564,6 +564,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnitTests-QoiThumbnailProvi EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CmdNotFoundModuleInterface", "src\modules\cmdNotFound\CmdNotFoundModuleInterface\CmdNotFoundModuleInterface.vcxproj", "{0014D652-901F-4456-8D65-06FC5F997FB0}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FileLocksmithContextMenu", "src\modules\FileLocksmith\FileLocksmithContextMenu\FileLocksmithContextMenu.vcxproj", "{799A50D8-DE89-4ED1-8FF8-AD5A9ED8C0CA}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FileLocksmithLib", "src\modules\FileLocksmith\FileLocksmithLib\FileLocksmithLib.vcxproj", "{9D52FD25-EF90-4F9A-A015-91EFC5DAF54F}" +EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UITests-FancyZones", "src\modules\fancyzones\UITests-FancyZones\UITests-FancyZones.csproj", "{FE38FC07-1C05-4B57-ADA3-2FE2F53C6A52}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UITests-FancyZonesEditor", "src\modules\fancyzones\UITests-FancyZonesEditor\UITests-FancyZonesEditor.csproj", "{3A9A791E-94A9-49F8-8401-C11CE288D5FB}" @@ -2470,6 +2474,30 @@ Global {0014D652-901F-4456-8D65-06FC5F997FB0}.Release|x64.Build.0 = Release|x64 {0014D652-901F-4456-8D65-06FC5F997FB0}.Release|x86.ActiveCfg = Release|Win32 {0014D652-901F-4456-8D65-06FC5F997FB0}.Release|x86.Build.0 = Release|Win32 + {799A50D8-DE89-4ED1-8FF8-AD5A9ED8C0CA}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {799A50D8-DE89-4ED1-8FF8-AD5A9ED8C0CA}.Debug|ARM64.Build.0 = Debug|ARM64 + {799A50D8-DE89-4ED1-8FF8-AD5A9ED8C0CA}.Debug|x64.ActiveCfg = Debug|x64 + {799A50D8-DE89-4ED1-8FF8-AD5A9ED8C0CA}.Debug|x64.Build.0 = Debug|x64 + {799A50D8-DE89-4ED1-8FF8-AD5A9ED8C0CA}.Debug|x86.ActiveCfg = Debug|x64 + {799A50D8-DE89-4ED1-8FF8-AD5A9ED8C0CA}.Debug|x86.Build.0 = Debug|x64 + {799A50D8-DE89-4ED1-8FF8-AD5A9ED8C0CA}.Release|ARM64.ActiveCfg = Release|ARM64 + {799A50D8-DE89-4ED1-8FF8-AD5A9ED8C0CA}.Release|ARM64.Build.0 = Release|ARM64 + {799A50D8-DE89-4ED1-8FF8-AD5A9ED8C0CA}.Release|x64.ActiveCfg = Release|x64 + {799A50D8-DE89-4ED1-8FF8-AD5A9ED8C0CA}.Release|x64.Build.0 = Release|x64 + {799A50D8-DE89-4ED1-8FF8-AD5A9ED8C0CA}.Release|x86.ActiveCfg = Release|x64 + {799A50D8-DE89-4ED1-8FF8-AD5A9ED8C0CA}.Release|x86.Build.0 = Release|x64 + {9D52FD25-EF90-4F9A-A015-91EFC5DAF54F}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {9D52FD25-EF90-4F9A-A015-91EFC5DAF54F}.Debug|ARM64.Build.0 = Debug|ARM64 + {9D52FD25-EF90-4F9A-A015-91EFC5DAF54F}.Debug|x64.ActiveCfg = Debug|x64 + {9D52FD25-EF90-4F9A-A015-91EFC5DAF54F}.Debug|x64.Build.0 = Debug|x64 + {9D52FD25-EF90-4F9A-A015-91EFC5DAF54F}.Debug|x86.ActiveCfg = Debug|x64 + {9D52FD25-EF90-4F9A-A015-91EFC5DAF54F}.Debug|x86.Build.0 = Debug|x64 + {9D52FD25-EF90-4F9A-A015-91EFC5DAF54F}.Release|ARM64.ActiveCfg = Release|ARM64 + {9D52FD25-EF90-4F9A-A015-91EFC5DAF54F}.Release|ARM64.Build.0 = Release|ARM64 + {9D52FD25-EF90-4F9A-A015-91EFC5DAF54F}.Release|x64.ActiveCfg = Release|x64 + {9D52FD25-EF90-4F9A-A015-91EFC5DAF54F}.Release|x64.Build.0 = Release|x64 + {9D52FD25-EF90-4F9A-A015-91EFC5DAF54F}.Release|x86.ActiveCfg = Release|x64 + {9D52FD25-EF90-4F9A-A015-91EFC5DAF54F}.Release|x86.Build.0 = Release|x64 {FE38FC07-1C05-4B57-ADA3-2FE2F53C6A52}.Debug|ARM64.ActiveCfg = Debug|ARM64 {FE38FC07-1C05-4B57-ADA3-2FE2F53C6A52}.Debug|ARM64.Build.0 = Debug|ARM64 {FE38FC07-1C05-4B57-ADA3-2FE2F53C6A52}.Debug|x64.ActiveCfg = Debug|x64 @@ -2701,6 +2729,8 @@ Global {3940AD4D-F748-4BE4-9083-85769CD553EF} = {2F305555-C296-497E-AC20-5FA1B237996A} {F8FFFC12-A31A-4AFA-B3DF-14DCF42B5E38} = {2F305555-C296-497E-AC20-5FA1B237996A} {0014D652-901F-4456-8D65-06FC5F997FB0} = {4C0D0746-BE5B-49EE-BD5D-A7811628AE8B} + {799A50D8-DE89-4ED1-8FF8-AD5A9ED8C0CA} = {AB82E5DD-C32D-4F28-9746-2C780846188E} + {9D52FD25-EF90-4F9A-A015-91EFC5DAF54F} = {AB82E5DD-C32D-4F28-9746-2C780846188E} {FE38FC07-1C05-4B57-ADA3-2FE2F53C6A52} = {D1D6BC88-09AE-4FB4-AD24-5DED46A791DD} {3A9A791E-94A9-49F8-8401-C11CE288D5FB} = {D1D6BC88-09AE-4FB4-AD24-5DED46A791DD} EndGlobalSection diff --git a/doc/devdocs/readme.md b/doc/devdocs/readme.md index 42e5b63e8d..fb0a7719f5 100644 --- a/doc/devdocs/readme.md +++ b/doc/devdocs/readme.md @@ -164,7 +164,7 @@ The definition of the interface used by the [`runner`](/src/runner) to manage th ### [`Common`](common.md) -The common lib, as the name suggests, contains code shared by multiple PowerToys components and modules, e.g. [json parsing](/src/common/json.h) and [IPC primitives](/src/common/two_way_pipe_message_ipc.h). +The common lib, as the name suggests, contains code shared by multiple PowerToys components and modules, e.g. [json parsing](/src/common/utils/json.h) and [IPC primitives](/src/common/interop/two_way_pipe_message_ipc.h). ### [`Settings`](settingsv2/) diff --git a/installer/PowerToysSetupCustomActions/CustomAction.cpp b/installer/PowerToysSetupCustomActions/CustomAction.cpp index 290df09898..a24713b5ac 100644 --- a/installer/PowerToysSetupCustomActions/CustomAction.cpp +++ b/installer/PowerToysSetupCustomActions/CustomAction.cpp @@ -952,7 +952,7 @@ UINT __stdcall UnRegisterContextMenuPackagesCA(MSIHANDLE hInstall) try { // Packages to unregister - const std::vector packagesToRemoveDisplayName{ { L"PowerRenameContextMenu" }, { L"ImageResizerContextMenu" } }; + const std::vector packagesToRemoveDisplayName{ { L"PowerRenameContextMenu" }, { L"ImageResizerContextMenu" }, { L"FileLocksmithContextMenu" } }; PackageManager packageManager; diff --git a/installer/PowerToysSetupCustomActions/PowerToysSetupCustomActions.vcxproj b/installer/PowerToysSetupCustomActions/PowerToysSetupCustomActions.vcxproj index 81235042b4..0bc8deb1f5 100644 --- a/installer/PowerToysSetupCustomActions/PowerToysSetupCustomActions.vcxproj +++ b/installer/PowerToysSetupCustomActions/PowerToysSetupCustomActions.vcxproj @@ -1,6 +1,6 @@  - + {32f3882b-f2d6-4586-b5ed-11e39e522bd3} @@ -164,13 +164,13 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/installer/PowerToysSetupCustomActions/packages.config b/installer/PowerToysSetupCustomActions/packages.config index 47bae1882f..09bfc449e2 100644 --- a/installer/PowerToysSetupCustomActions/packages.config +++ b/installer/PowerToysSetupCustomActions/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/ActionRunner/actionRunner.vcxproj b/src/ActionRunner/actionRunner.vcxproj index 8809611842..cc41616bba 100644 --- a/src/ActionRunner/actionRunner.vcxproj +++ b/src/ActionRunner/actionRunner.vcxproj @@ -1,6 +1,6 @@ - + @@ -61,15 +61,15 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/src/ActionRunner/packages.config b/src/ActionRunner/packages.config index 2c654a3e7d..ff4b059648 100644 --- a/src/ActionRunner/packages.config +++ b/src/ActionRunner/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/src/Update/PowerToys.Update.vcxproj b/src/Update/PowerToys.Update.vcxproj index 914732926c..172a7027a6 100644 --- a/src/Update/PowerToys.Update.vcxproj +++ b/src/Update/PowerToys.Update.vcxproj @@ -1,6 +1,6 @@ - + @@ -67,15 +67,15 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/src/Update/packages.config b/src/Update/packages.config index 2c654a3e7d..ff4b059648 100644 --- a/src/Update/packages.config +++ b/src/Update/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/src/common/FilePreviewCommon/Assets/Monaco/monacoSpecialLanguages.js b/src/common/FilePreviewCommon/Assets/Monaco/monacoSpecialLanguages.js index 3a35b9be12..3e092ffa04 100644 --- a/src/common/FilePreviewCommon/Assets/Monaco/monacoSpecialLanguages.js +++ b/src/common/FilePreviewCommon/Assets/Monaco/monacoSpecialLanguages.js @@ -7,10 +7,11 @@ export async function registerAdditionalLanguages(monaco){ await languageDefinitions(); registerAdditionalLanguage("cppExt", [".ino", ".pde"], "cpp", monaco) registerAdditionalLanguage("xmlExt", [".wsdl", ".csproj", ".vcxproj", ".vbproj", ".fsproj"], "xml", monaco) - registerAdditionalLanguage("txtExt", [".sln", ".log", ".vsconfig"], "txt", monaco) + registerAdditionalLanguage("txtExt", [".sln", ".log", ".vsconfig", ".env"], "txt", monaco) registerAdditionalLanguage("razorExt", [".razor"], "razor", monaco) registerAdditionalLanguage("vbExt", [".vbs"], "vb", monaco) registerAdditionalLanguage("iniExt", [".inf", ".gitconfig", ".gitattributes", ".editorconfig"], "ini", monaco) + registerAdditionalLanguage("shellExt", [".ksh", ".zsh", ".bsh"], "shell", monaco) registerAdditionalNewLanguage("reg", [".reg"], regDefinition(), monaco) registerAdditionalNewLanguage("gitignore", [".gitignore"], gitignoreDefinition(), monaco) } @@ -37,6 +38,10 @@ async function languageDefinitions() { var moduleExports = (() => { var t = Object.defineProperty; var i = Object.getOwnPropertyDescriptor; var r = Object.getOwnPropertyNames; var g = Object.prototype.hasOwnProperty; var c = (n, e) => { for (var s in e) t(n, s, { get: e[s], enumerable: !0 }) }, l = (n, e, s, a) => { if (e && typeof e == "object" || typeof e == "function") for (let o of r(e)) !g.call(n, o) && o !== s && t(n, o, { get: () => e[o], enumerable: !(a = i(e, o)) || a.enumerable }); return n }; var p = n => l(t({}, "__esModule", { value: !0 }), n); var f = {}; c(f, { conf: () => u, language: () => m }); var u = { comments: { lineComment: "#" }, brackets: [["{", "}"], ["[", "]"], ["(", ")"]], autoClosingPairs: [{ open: "{", close: "}" }, { open: "[", close: "]" }, { open: "(", close: ")" }, { open: '"', close: '"' }, { open: "'", close: "'" }], surroundingPairs: [{ open: "{", close: "}" }, { open: "[", close: "]" }, { open: "(", close: ")" }, { open: '"', close: '"' }, { open: "'", close: "'" }] }, m = { defaultToken: "", tokenPostfix: ".ini", escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/, tokenizer: { root: [[/^\[[^\]]*\]/, "metatag"], [/(^\w+)(\s*)(\=)/, ["key", "", "delimiter"]], { include: "@whitespace" }, [/\d+/, "number"], [/"([^"\\]|\\.)*$/, "string.invalid"], [/'([^'\\]|\\.)*$/, "string.invalid"], [/"/, "string", '@string."'], [/'/, "string", "@string.'"]], whitespace: [[/[ \t\r\n]+/, ""], [/^\s*[#;].*$/, "comment"]], string: [[/[^\\"']+/, "string"], [/@escapes/, "string.escape"], [/\\./, "string.escape.invalid"], [/["']/, { cases: { "$#==$S2": { token: "string", next: "@pop" }, "@default": "string" } }]] } }; return p(f); })(); return moduleExports; }); + define("vs/basic-languages/shell/shell", ["require","require"],(require)=>{ + var moduleExports = (() => { var a = Object.defineProperty; var s = Object.getOwnPropertyDescriptor; var n = Object.getOwnPropertyNames; var l = Object.prototype.hasOwnProperty; var c = (r, e) => { for (var i in e) a(r, i, { get: e[i], enumerable: !0 }) }, d = (r, e, i, o) => { if (e && typeof e == "object" || typeof e == "function") for (let t of n(e)) !l.call(r, t) && t !== i && a(r, t, { get: () => e[t], enumerable: !(o = s(e, t)) || o.enumerable }); return r }; var p = r => d(a({}, "__esModule", { value: !0 }), r); var g = {}; c(g, { conf: () => m, language: () => u }); var m = { comments: { lineComment: "#" }, brackets: [["{", "}"], ["[", "]"], ["(", ")"]], autoClosingPairs: [{ open: "{", close: "}" }, { open: "[", close: "]" }, { open: "(", close: ")" }, { open: '"', close: '"' }, { open: "'", close: "'" }, { open: "`", close: "`" }], surroundingPairs: [{ open: "{", close: "}" }, { open: "[", close: "]" }, { open: "(", close: ")" }, { open: '"', close: '"' }, { open: "'", close: "'" }, { open: "`", close: "`" }] }, u = { defaultToken: "", ignoreCase: !0, tokenPostfix: ".shell", brackets: [{ token: "delimiter.bracket", open: "{", close: "}" }, { token: "delimiter.parenthesis", open: "(", close: ")" }, { token: "delimiter.square", open: "[", close: "]" }], keywords: ["if", "then", "do", "else", "elif", "while", "until", "for", "in", "esac", "fi", "fin", "fil", "done", "exit", "set", "unset", "export", "function"], builtins: ["ab", "awk", "bash", "beep", "cat", "cc", "cd", "chown", "chmod", "chroot", "clear", "cp", "curl", "cut", "diff", "echo", "find", "gawk", "gcc", "get", "git", "grep", "hg", "kill", "killall", "ln", "ls", "make", "mkdir", "openssl", "mv", "nc", "node", "npm", "ping", "ps", "restart", "rm", "rmdir", "sed", "service", "sh", "shopt", "shred", "source", "sort", "sleep", "ssh", "start", "stop", "su", "sudo", "svn", "tee", "telnet", "top", "touch", "vi", "vim", "wall", "wc", "wget", "who", "write", "yes", "zsh"], startingWithDash: /\-+\w+/, identifiersWithDashes: /[a-zA-Z]\w+(?:@startingWithDash)+/, symbols: /[=> - + true true @@ -118,13 +118,13 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/src/common/GPOWrapper/packages.config b/src/common/GPOWrapper/packages.config index 47bae1882f..09bfc449e2 100644 --- a/src/common/GPOWrapper/packages.config +++ b/src/common/GPOWrapper/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/common/SettingsAPI/SettingsAPI.vcxproj b/src/common/SettingsAPI/SettingsAPI.vcxproj index c8a06a1a9e..bf2eaec6dc 100644 --- a/src/common/SettingsAPI/SettingsAPI.vcxproj +++ b/src/common/SettingsAPI/SettingsAPI.vcxproj @@ -1,6 +1,6 @@ - + 16.0 @@ -54,15 +54,15 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/src/common/SettingsAPI/packages.config b/src/common/SettingsAPI/packages.config index 47bae1882f..09bfc449e2 100644 --- a/src/common/SettingsAPI/packages.config +++ b/src/common/SettingsAPI/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/common/Themes/Themes.vcxproj b/src/common/Themes/Themes.vcxproj index c60dde82a7..f9772c874f 100644 --- a/src/common/Themes/Themes.vcxproj +++ b/src/common/Themes/Themes.vcxproj @@ -1,6 +1,6 @@ - + 16.0 {98537082-0FDB-40DE-ABD8-0DC5A4269BAB} @@ -46,13 +46,13 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/src/common/Themes/packages.config b/src/common/Themes/packages.config index 47bae1882f..09bfc449e2 100644 --- a/src/common/Themes/packages.config +++ b/src/common/Themes/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/common/UnitTests-CommonLib/UnitTests-CommonLib.vcxproj b/src/common/UnitTests-CommonLib/UnitTests-CommonLib.vcxproj index f3dd518759..aff6610d66 100644 --- a/src/common/UnitTests-CommonLib/UnitTests-CommonLib.vcxproj +++ b/src/common/UnitTests-CommonLib/UnitTests-CommonLib.vcxproj @@ -1,6 +1,6 @@ - + 16.0 {1A066C63-64B3-45F8-92FE-664E1CCE8077} @@ -57,13 +57,13 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/src/common/UnitTests-CommonLib/packages.config b/src/common/UnitTests-CommonLib/packages.config index 47bae1882f..09bfc449e2 100644 --- a/src/common/UnitTests-CommonLib/packages.config +++ b/src/common/UnitTests-CommonLib/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/common/logger/logger.vcxproj b/src/common/logger/logger.vcxproj index f4915e78e3..49efbd6f86 100644 --- a/src/common/logger/logger.vcxproj +++ b/src/common/logger/logger.vcxproj @@ -1,6 +1,6 @@ - + Debug @@ -83,13 +83,13 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/src/common/logger/packages.config b/src/common/logger/packages.config index 47bae1882f..09bfc449e2 100644 --- a/src/common/logger/packages.config +++ b/src/common/logger/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/common/notifications/BackgroundActivator/BackgroundActivator.vcxproj b/src/common/notifications/BackgroundActivator/BackgroundActivator.vcxproj index 9b4443c380..077333a664 100644 --- a/src/common/notifications/BackgroundActivator/BackgroundActivator.vcxproj +++ b/src/common/notifications/BackgroundActivator/BackgroundActivator.vcxproj @@ -1,6 +1,6 @@ - + true true @@ -96,13 +96,13 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/src/common/notifications/BackgroundActivator/packages.config b/src/common/notifications/BackgroundActivator/packages.config index 47bae1882f..09bfc449e2 100644 --- a/src/common/notifications/BackgroundActivator/packages.config +++ b/src/common/notifications/BackgroundActivator/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/common/notifications/BackgroundActivatorDLL/BackgroundActivatorDLL.vcxproj b/src/common/notifications/BackgroundActivatorDLL/BackgroundActivatorDLL.vcxproj index 394fd21d9b..3a96d7d46f 100644 --- a/src/common/notifications/BackgroundActivatorDLL/BackgroundActivatorDLL.vcxproj +++ b/src/common/notifications/BackgroundActivatorDLL/BackgroundActivatorDLL.vcxproj @@ -1,6 +1,6 @@ - + 16.0 {031AC72E-FA28-4AB7-B690-6F7B9C28AA73} @@ -64,7 +64,7 @@ - + @@ -81,7 +81,7 @@ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/src/common/notifications/BackgroundActivatorDLL/packages.config b/src/common/notifications/BackgroundActivatorDLL/packages.config index 47bae1882f..09bfc449e2 100644 --- a/src/common/notifications/BackgroundActivatorDLL/packages.config +++ b/src/common/notifications/BackgroundActivatorDLL/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/common/notifications/notifications.vcxproj b/src/common/notifications/notifications.vcxproj index c0438616ad..9ff8830793 100644 --- a/src/common/notifications/notifications.vcxproj +++ b/src/common/notifications/notifications.vcxproj @@ -1,6 +1,6 @@ - + 16.0 {1D5BE09D-78C0-4FD7-AF00-AE7C1AF7C525} @@ -43,15 +43,15 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/src/common/notifications/packages.config b/src/common/notifications/packages.config index 2c654a3e7d..ff4b059648 100644 --- a/src/common/notifications/packages.config +++ b/src/common/notifications/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/src/common/updating/packages.config b/src/common/updating/packages.config index 2c654a3e7d..ff4b059648 100644 --- a/src/common/updating/packages.config +++ b/src/common/updating/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/src/common/updating/updating.vcxproj b/src/common/updating/updating.vcxproj index dfd2817d83..48c3d5d483 100644 --- a/src/common/updating/updating.vcxproj +++ b/src/common/updating/updating.vcxproj @@ -1,6 +1,6 @@ - + 16.0 {17DA04DF-E393-4397-9CF0-84DABE11032E} @@ -57,15 +57,15 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/src/modules/CropAndLock/CropAndLock/CropAndLock.vcxproj b/src/modules/CropAndLock/CropAndLock/CropAndLock.vcxproj index fabdbc9c25..ebaed7e24f 100644 --- a/src/modules/CropAndLock/CropAndLock/CropAndLock.vcxproj +++ b/src/modules/CropAndLock/CropAndLock/CropAndLock.vcxproj @@ -1,6 +1,6 @@ - + true true @@ -122,6 +122,7 @@ + @@ -154,7 +155,7 @@ - + @@ -162,8 +163,8 @@ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + diff --git a/src/modules/CropAndLock/CropAndLock/DispatcherQueue.desktop.interop.h b/src/modules/CropAndLock/CropAndLock/DispatcherQueue.desktop.interop.h new file mode 100644 index 0000000000..2991b438a4 --- /dev/null +++ b/src/modules/CropAndLock/CropAndLock/DispatcherQueue.desktop.interop.h @@ -0,0 +1,51 @@ +#pragma once +#include +#include +#include + +// This file is added as a workaround for: https://github.com/microsoft/cppwinrt/issues/1391 +// robmikh.common needs to be updated to support newer versions of C++/WinRT https://github.com/robmikh/robmikh.common/issues/2 +// Applying workaround from https://github.com/robmikh/Win32CaptureSample/commit/fc758e343ca886795b05af5003d9a3bb85ff4da2 + +namespace robmikh::common::desktop +{ + namespace impl + { + inline void ShutdownAndThenPostQuitMessage(winrt::Windows::System::DispatcherQueueController const& controller, int exitCode) + { + auto action = controller.ShutdownQueueAsync(); + action.Completed([exitCode](auto&&, auto&&) + { + PostQuitMessage(exitCode); + }); + } + } + + inline auto CreateDispatcherQueueControllerForCurrentThread() + { + namespace abi = ABI::Windows::System; + + DispatcherQueueOptions options + { + sizeof(DispatcherQueueOptions), + DQTYPE_THREAD_CURRENT, + DQTAT_COM_NONE + }; + + winrt::Windows::System::DispatcherQueueController controller{ nullptr }; + winrt::check_hresult(CreateDispatcherQueueController(options, reinterpret_cast(winrt::put_abi(controller)))); + return controller; + } + + inline int ShutdownDispatcherQueueControllerAndWait(winrt::Windows::System::DispatcherQueueController const& controller, int exitCode) + { + impl::ShutdownAndThenPostQuitMessage(controller, exitCode); + MSG msg = {}; + while (GetMessageW(&msg, nullptr, 0, 0)) + { + TranslateMessage(&msg); + DispatchMessageW(&msg); + } + return static_cast(msg.wParam); + } +} diff --git a/src/modules/CropAndLock/CropAndLock/packages.config b/src/modules/CropAndLock/CropAndLock/packages.config index fe9625b6da..f53ff9a92d 100644 --- a/src/modules/CropAndLock/CropAndLock/packages.config +++ b/src/modules/CropAndLock/CropAndLock/packages.config @@ -1,6 +1,6 @@  - + \ No newline at end of file diff --git a/src/modules/CropAndLock/CropAndLock/pch.h b/src/modules/CropAndLock/CropAndLock/pch.h index fe9e5e635e..720033cbca 100644 --- a/src/modules/CropAndLock/CropAndLock/pch.h +++ b/src/modules/CropAndLock/CropAndLock/pch.h @@ -26,6 +26,7 @@ // WIL #include +#include // DirectX #include @@ -53,7 +54,10 @@ #include #include #include -#include +// robmikh.common needs to be updated to support newer versions of C++/WinRT https://github.com/robmikh/robmikh.common/issues/2 +// Applying workaround from https://github.com/robmikh/Win32CaptureSample/commit/fc758e343ca886795b05af5003d9a3bb85ff4da2 +// #include +#include "DispatcherQueue.desktop.interop.h" #include #include #include diff --git a/src/modules/CropAndLock/CropAndLockModuleInterface/CropAndLockModuleInterface.vcxproj b/src/modules/CropAndLock/CropAndLockModuleInterface/CropAndLockModuleInterface.vcxproj index 6c44320941..6aa29bfe95 100644 --- a/src/modules/CropAndLock/CropAndLockModuleInterface/CropAndLockModuleInterface.vcxproj +++ b/src/modules/CropAndLock/CropAndLockModuleInterface/CropAndLockModuleInterface.vcxproj @@ -1,6 +1,6 @@ - + 16.0 Win32Proj @@ -101,7 +101,7 @@ - + @@ -110,8 +110,8 @@ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + diff --git a/src/modules/CropAndLock/CropAndLockModuleInterface/packages.config b/src/modules/CropAndLock/CropAndLockModuleInterface/packages.config index 2c654a3e7d..ff4b059648 100644 --- a/src/modules/CropAndLock/CropAndLockModuleInterface/packages.config +++ b/src/modules/CropAndLock/CropAndLockModuleInterface/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/src/modules/EnvironmentVariables/EnvironmentVariablesModuleInterface/EnvironmentVariablesModuleInterface.vcxproj b/src/modules/EnvironmentVariables/EnvironmentVariablesModuleInterface/EnvironmentVariablesModuleInterface.vcxproj index 6bf3bb3b20..b332a8c8e4 100644 --- a/src/modules/EnvironmentVariables/EnvironmentVariablesModuleInterface/EnvironmentVariablesModuleInterface.vcxproj +++ b/src/modules/EnvironmentVariables/EnvironmentVariablesModuleInterface/EnvironmentVariablesModuleInterface.vcxproj @@ -1,5 +1,6 @@ + @@ -76,6 +77,7 @@ + @@ -107,5 +109,13 @@ + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + \ No newline at end of file diff --git a/src/modules/EnvironmentVariables/EnvironmentVariablesModuleInterface/EnvironmentVariablesModuleInterface.vcxproj.filters b/src/modules/EnvironmentVariables/EnvironmentVariablesModuleInterface/EnvironmentVariablesModuleInterface.vcxproj.filters index 14b6af8966..8ecdef4543 100644 --- a/src/modules/EnvironmentVariables/EnvironmentVariablesModuleInterface/EnvironmentVariablesModuleInterface.vcxproj.filters +++ b/src/modules/EnvironmentVariables/EnvironmentVariablesModuleInterface/EnvironmentVariablesModuleInterface.vcxproj.filters @@ -43,6 +43,7 @@ Resource Files + diff --git a/src/modules/EnvironmentVariables/EnvironmentVariablesModuleInterface/packages.config b/src/modules/EnvironmentVariables/EnvironmentVariablesModuleInterface/packages.config new file mode 100644 index 0000000000..09bfc449e2 --- /dev/null +++ b/src/modules/EnvironmentVariables/EnvironmentVariablesModuleInterface/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/src/modules/FileLocksmith/FileLocksmithContextMenu/AppxManifest.xml b/src/modules/FileLocksmith/FileLocksmithContextMenu/AppxManifest.xml new file mode 100644 index 0000000000..1fd5adf832 --- /dev/null +++ b/src/modules/FileLocksmith/FileLocksmithContextMenu/AppxManifest.xml @@ -0,0 +1,56 @@ + + + + + PowerToys FileLocksmith Context Menu + Microsoft + Assets\FileLocksmith\storelogo.png + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/modules/FileLocksmith/FileLocksmithContextMenu/Assets/FileLocksmith/FileLocksmith.ico b/src/modules/FileLocksmith/FileLocksmithContextMenu/Assets/FileLocksmith/FileLocksmith.ico new file mode 100644 index 0000000000..629b119069 Binary files /dev/null and b/src/modules/FileLocksmith/FileLocksmithContextMenu/Assets/FileLocksmith/FileLocksmith.ico differ diff --git a/src/modules/FileLocksmith/FileLocksmithContextMenu/Assets/FileLocksmith/LargeTile.png b/src/modules/FileLocksmith/FileLocksmithContextMenu/Assets/FileLocksmith/LargeTile.png new file mode 100644 index 0000000000..f8a9f8f193 Binary files /dev/null and b/src/modules/FileLocksmith/FileLocksmithContextMenu/Assets/FileLocksmith/LargeTile.png differ diff --git a/src/modules/FileLocksmith/FileLocksmithContextMenu/Assets/FileLocksmith/SmallTile.png b/src/modules/FileLocksmith/FileLocksmithContextMenu/Assets/FileLocksmith/SmallTile.png new file mode 100644 index 0000000000..8773d6366a Binary files /dev/null and b/src/modules/FileLocksmith/FileLocksmithContextMenu/Assets/FileLocksmith/SmallTile.png differ diff --git a/src/modules/FileLocksmith/FileLocksmithContextMenu/Assets/FileLocksmith/SplashScreen.png b/src/modules/FileLocksmith/FileLocksmithContextMenu/Assets/FileLocksmith/SplashScreen.png new file mode 100644 index 0000000000..9d421b9526 Binary files /dev/null and b/src/modules/FileLocksmith/FileLocksmithContextMenu/Assets/FileLocksmith/SplashScreen.png differ diff --git a/src/modules/FileLocksmith/FileLocksmithContextMenu/Assets/FileLocksmith/Square150x150Logo.png b/src/modules/FileLocksmith/FileLocksmithContextMenu/Assets/FileLocksmith/Square150x150Logo.png new file mode 100644 index 0000000000..f8a9f8f193 Binary files /dev/null and b/src/modules/FileLocksmith/FileLocksmithContextMenu/Assets/FileLocksmith/Square150x150Logo.png differ diff --git a/src/modules/FileLocksmith/FileLocksmithContextMenu/Assets/FileLocksmith/Square44x44Logo.png b/src/modules/FileLocksmith/FileLocksmithContextMenu/Assets/FileLocksmith/Square44x44Logo.png new file mode 100644 index 0000000000..8773d6366a Binary files /dev/null and b/src/modules/FileLocksmith/FileLocksmithContextMenu/Assets/FileLocksmith/Square44x44Logo.png differ diff --git a/src/modules/FileLocksmith/FileLocksmithContextMenu/Assets/FileLocksmith/Wide310x150Logo.png b/src/modules/FileLocksmith/FileLocksmithContextMenu/Assets/FileLocksmith/Wide310x150Logo.png new file mode 100644 index 0000000000..266b41d25b Binary files /dev/null and b/src/modules/FileLocksmith/FileLocksmithContextMenu/Assets/FileLocksmith/Wide310x150Logo.png differ diff --git a/src/modules/FileLocksmith/FileLocksmithContextMenu/Assets/FileLocksmith/storelogo.png b/src/modules/FileLocksmith/FileLocksmithContextMenu/Assets/FileLocksmith/storelogo.png new file mode 100644 index 0000000000..dfbca016bc Binary files /dev/null and b/src/modules/FileLocksmith/FileLocksmithContextMenu/Assets/FileLocksmith/storelogo.png differ diff --git a/src/modules/FileLocksmith/FileLocksmithContextMenu/FileLocksmithContextMenu.base.rc b/src/modules/FileLocksmith/FileLocksmithContextMenu/FileLocksmithContextMenu.base.rc new file mode 100644 index 0000000000..bc168f0621 --- /dev/null +++ b/src/modules/FileLocksmith/FileLocksmithContextMenu/FileLocksmithContextMenu.base.rc @@ -0,0 +1,50 @@ +#include +#include "Generated Files/resource.h" +#include "../../../common/version/version.h" + +#define APSTUDIO_READONLY_SYMBOLS +#include "winres.h" +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION FILE_VERSION + PRODUCTVERSION PRODUCT_VERSION + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", COMPANY_NAME + VALUE "FileDescription", FILE_DESCRIPTION + VALUE "FileVersion", FILE_VERSION_STRING + VALUE "InternalName", INTERNAL_NAME + VALUE "LegalCopyright", COPYRIGHT_NOTE + VALUE "OriginalFilename", ORIGINAL_FILENAME + VALUE "ProductName", PRODUCT_NAME + VALUE "ProductVersion", PRODUCT_VERSION_STRING + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END diff --git a/src/modules/FileLocksmith/FileLocksmithContextMenu/FileLocksmithContextMenu.vcxproj b/src/modules/FileLocksmith/FileLocksmithContextMenu/FileLocksmithContextMenu.vcxproj new file mode 100644 index 0000000000..f1d35839c0 --- /dev/null +++ b/src/modules/FileLocksmith/FileLocksmithContextMenu/FileLocksmithContextMenu.vcxproj @@ -0,0 +1,130 @@ + + + + + + + 17.0 + Win32Proj + {799a50d8-de89-4ed1-8ff8-ad5a9ed8c0ca} + FileLocksmithContextMenu + + + + PowerToys.FileLocksmithContextMenu + + $(SolutionDir)$(Platform)\$(Configuration)\TemporaryBuild\obj\$(ProjectName)\ + ..\..\..\..\$(Platform)\$(Configuration)\WinUI3Apps\ + + + DynamicLibrary + true + v143 + Unicode + + + DynamicLibrary + false + v143 + true + Unicode + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;FILELOCKSMITHCONTEXTMENU_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + Use + ..;../../..; + + + Windows + true + false + runtimeobject.lib;%(AdditionalDependencies) + Source.def + + + del $(OutDir)\FileLocksmithContextMenuPackage.msix /q +MakeAppx.exe pack /d . /p $(OutDir)FileLocksmithContextMenuPackage.msix /nv + + + + + Level3 + true + true + true + WIN32;NDEBUG;FILELOCKSMITHCONTEXTMENU_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + Use + ..;../../..; + + + Windows + true + true + true + false + runtimeobject.lib;%(AdditionalDependencies) + Source.def + + + del $(OutDir)\FileLocksmithContextMenuPackage.msix /q +MakeAppx.exe pack /d . /p $(OutDir)FileLocksmithContextMenuPackage.msix /nv + + + + + + + + + + + Create + + + + + + + + + + + + {6955446d-23f7-4023-9bb3-8657f904af99} + + + {cc6e41ac-8174-4e8a-8d22-85dd7f4851df} + + + {9d52fd25-ef90-4f9a-a015-91efc5daf54f} + + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + \ No newline at end of file diff --git a/src/modules/FileLocksmith/FileLocksmithContextMenu/FileLocksmithContextMenu.vcxproj.filters b/src/modules/FileLocksmith/FileLocksmithContextMenu/FileLocksmithContextMenu.vcxproj.filters new file mode 100644 index 0000000000..4e95cc85ee --- /dev/null +++ b/src/modules/FileLocksmith/FileLocksmithContextMenu/FileLocksmithContextMenu.vcxproj.filters @@ -0,0 +1,46 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + + + Resource Files + + + + + Resource Files + + + \ No newline at end of file diff --git a/src/modules/FileLocksmith/FileLocksmithContextMenu/Resources.resx b/src/modules/FileLocksmith/FileLocksmithContextMenu/Resources.resx new file mode 100644 index 0000000000..beb863e7e8 --- /dev/null +++ b/src/modules/FileLocksmith/FileLocksmithContextMenu/Resources.resx @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Unlock with File Locksmith + This text will be shown when the user opens the context menu (right clicks) a file. File Locksmith is the product name, do not loc. + + + File Locksmith + + \ No newline at end of file diff --git a/src/modules/FileLocksmith/FileLocksmithContextMenu/Source.def b/src/modules/FileLocksmith/FileLocksmithContextMenu/Source.def new file mode 100644 index 0000000000..1ffdadd7a1 --- /dev/null +++ b/src/modules/FileLocksmith/FileLocksmithContextMenu/Source.def @@ -0,0 +1,5 @@ +LIBRARY +EXPORTS +DllCanUnloadNow PRIVATE +DllGetClassObject PRIVATE +DllGetActivationFactory PRIVATE \ No newline at end of file diff --git a/src/modules/FileLocksmith/FileLocksmithContextMenu/dllmain.cpp b/src/modules/FileLocksmith/FileLocksmithContextMenu/dllmain.cpp new file mode 100644 index 0000000000..1abf0e947b --- /dev/null +++ b/src/modules/FileLocksmith/FileLocksmithContextMenu/dllmain.cpp @@ -0,0 +1,189 @@ +// dllmain.cpp : Defines the entry point for the DLL application. +#include "pch.h" + +#include +#include +#include + +#include "FileLocksmithLib/IPC.h" +#include "FileLocksmithLib/Settings.h" +#include "FileLocksmithLib/Trace.h" + +#include +#include +#include +#include + +#include "Generated Files/resource.h" + + +using namespace Microsoft::WRL; + +HINSTANCE g_hInst = 0; + +BOOL APIENTRY DllMain( HMODULE hModule, + DWORD ul_reason_for_call, + LPVOID lpReserved + ) +{ + switch (ul_reason_for_call) + { + case DLL_PROCESS_ATTACH: + g_hInst = hModule; + Trace::RegisterProvider(); + break; + case DLL_PROCESS_DETACH: + Trace::UnregisterProvider(); + break; + } + return TRUE; +} + +class __declspec(uuid("AAF1E27D-4976-49C2-8895-AAFA743C0A7E")) FileLocksmithContextMenuCommand final : public RuntimeClass, IExplorerCommand, IObjectWithSite> +{ +public: + virtual const wchar_t* Title() { return L"File Locksmith"; } + virtual const EXPCMDFLAGS Flags() { return ECF_DEFAULT; } + virtual const EXPCMDSTATE State(_In_opt_ IShellItemArray* selection) { return ECS_ENABLED; } + + // IExplorerCommand + IFACEMETHODIMP GetTitle(_In_opt_ IShellItemArray* items, _Outptr_result_nullonfailure_ PWSTR* name) + { + return SHStrDup(context_menu_caption.c_str(), name); + } + + IFACEMETHODIMP GetIcon(_In_opt_ IShellItemArray*, _Outptr_result_nullonfailure_ PWSTR* icon) + { + std::wstring iconResourcePath = get_module_folderpath(g_hInst); + iconResourcePath += L"\\Assets\\FileLocksmith\\"; + iconResourcePath += L"FileLocksmith.ico"; + return SHStrDup(iconResourcePath.c_str(), icon); + } + + IFACEMETHODIMP GetToolTip(_In_opt_ IShellItemArray*, _Outptr_result_nullonfailure_ PWSTR* infoTip) + { + *infoTip = nullptr; + return E_NOTIMPL; + } + + IFACEMETHODIMP GetCanonicalName(_Out_ GUID* guidCommandName) + { + *guidCommandName = __uuidof(this); + return S_OK; + } + + IFACEMETHODIMP GetState(_In_opt_ IShellItemArray* selection, _In_ BOOL okToBeSlow, _Out_ EXPCMDSTATE* cmdState) + { + *cmdState = ECS_ENABLED; + + if (!FileLocksmithSettingsInstance().GetEnabled()) + { + *cmdState = ECS_HIDDEN; + } + + if (FileLocksmithSettingsInstance().GetShowInExtendedContextMenu()) + { + *cmdState = ECS_HIDDEN; + } + + return S_OK; + } + + IFACEMETHODIMP Invoke(_In_opt_ IShellItemArray* selection, _In_opt_ IBindCtx*) noexcept + { + Trace::Invoked(); + ipc::Writer writer; + + if (selection == nullptr) + { + return S_OK; + } + + if (HRESULT result = writer.start(); FAILED(result)) + { + Trace::InvokedRet(result); + return result; + } + + std::wstring path = get_module_folderpath(g_hInst); + path = path + L"\\PowerToys.FileLocksmithUI.exe"; + + HRESULT result; + + if (!RunNonElevatedEx(path.c_str(), L"", get_module_folderpath(g_hInst))) + { + result = E_FAIL; + Trace::InvokedRet(result); + return result; + } + + DWORD num_items; + selection->GetCount(&num_items); + + for (DWORD i = 0; i < num_items; i++) + { + IShellItem* item; + result = selection->GetItemAt(i, &item); + if (SUCCEEDED(result)) + { + LPWSTR file_path; + result = item->GetDisplayName(SIGDN_FILESYSPATH, &file_path); + if (SUCCEEDED(result)) + { + // TODO Aggregate items and send to UI + writer.add_path(file_path); + CoTaskMemFree(file_path); + } + + item->Release(); + } + } + + Trace::InvokedRet(S_OK); + return S_OK; + } + + IFACEMETHODIMP GetFlags(_Out_ EXPCMDFLAGS* flags) + { + *flags = Flags(); + return S_OK; + } + IFACEMETHODIMP EnumSubCommands(_COM_Outptr_ IEnumExplorerCommand** enumCommands) + { + *enumCommands = nullptr; + return E_NOTIMPL; + } + + // IObjectWithSite + IFACEMETHODIMP SetSite(_In_ IUnknown* site) noexcept + { + m_site = site; + return S_OK; + } + IFACEMETHODIMP GetSite(_In_ REFIID riid, _COM_Outptr_ void** site) noexcept { return m_site.CopyTo(riid, site); } + +protected: + ComPtr m_site; + +private: + std::wstring context_menu_caption = GET_RESOURCE_STRING_FALLBACK(IDS_FILE_LOCKSMITH_CONTEXT_MENU_ENTRY, L"Unlock with File Locksmith"); +}; + +CoCreatableClass(FileLocksmithContextMenuCommand) +CoCreatableClassWrlCreatorMapInclude(FileLocksmithContextMenuCommand) + + +STDAPI DllGetActivationFactory(_In_ HSTRING activatableClassId, _COM_Outptr_ IActivationFactory** factory) +{ + return Module::GetModule().GetActivationFactory(activatableClassId, factory); +} + +STDAPI DllCanUnloadNow() +{ + return Module::GetModule().GetObjectCount() == 0 ? S_OK : S_FALSE; +} + +STDAPI DllGetClassObject(_In_ REFCLSID rclsid, _In_ REFIID riid, _COM_Outptr_ void** instance) +{ + return Module::GetModule().GetClassObject(rclsid, riid, instance); +} diff --git a/src/modules/FileLocksmith/FileLocksmithContextMenu/framework.h b/src/modules/FileLocksmith/FileLocksmithContextMenu/framework.h new file mode 100644 index 0000000000..54b83e94fd --- /dev/null +++ b/src/modules/FileLocksmith/FileLocksmithContextMenu/framework.h @@ -0,0 +1,5 @@ +#pragma once + +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +// Windows Header Files +#include diff --git a/src/modules/FileLocksmith/FileLocksmithContextMenu/packages.config b/src/modules/FileLocksmith/FileLocksmithContextMenu/packages.config new file mode 100644 index 0000000000..6199e2345c --- /dev/null +++ b/src/modules/FileLocksmith/FileLocksmithContextMenu/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/src/modules/FileLocksmith/FileLocksmithContextMenu/pch.cpp b/src/modules/FileLocksmith/FileLocksmithContextMenu/pch.cpp new file mode 100644 index 0000000000..64b7eef6d6 --- /dev/null +++ b/src/modules/FileLocksmith/FileLocksmithContextMenu/pch.cpp @@ -0,0 +1,5 @@ +// pch.cpp: source file corresponding to the pre-compiled header + +#include "pch.h" + +// When you are using pre-compiled headers, this source file is necessary for compilation to succeed. diff --git a/src/modules/FileLocksmith/FileLocksmithContextMenu/pch.h b/src/modules/FileLocksmith/FileLocksmithContextMenu/pch.h new file mode 100644 index 0000000000..885d5d62e4 --- /dev/null +++ b/src/modules/FileLocksmith/FileLocksmithContextMenu/pch.h @@ -0,0 +1,13 @@ +// pch.h: This is a precompiled header file. +// Files listed below are compiled only once, improving build performance for future builds. +// This also affects IntelliSense performance, including code completion and many code browsing features. +// However, files listed here are ALL re-compiled if any one of them is updated between builds. +// Do not add files here that you will be updating frequently as this negates the performance advantage. + +#ifndef PCH_H +#define PCH_H + +// add headers that you want to pre-compile here +#include "framework.h" + +#endif //PCH_H diff --git a/src/modules/FileLocksmith/FileLocksmithContextMenu/resource.base.h b/src/modules/FileLocksmith/FileLocksmithContextMenu/resource.base.h new file mode 100644 index 0000000000..0f984b9721 --- /dev/null +++ b/src/modules/FileLocksmith/FileLocksmithContextMenu/resource.base.h @@ -0,0 +1,13 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by ImageResizerContextMenu.rc + +////////////////////////////// +// Non-localizable + +#define FILE_DESCRIPTION "PowerToys File Locksmith Context Menu" +#define INTERNAL_NAME "PowerToys.FileLocksmithContextMenu.dll" +#define ORIGINAL_FILENAME "PowerToys.FileLocksmithContextMenu.dll" + +// Non-localizable +////////////////////////////// diff --git a/src/modules/FileLocksmith/FileLocksmithExt/ExplorerCommand.cpp b/src/modules/FileLocksmith/FileLocksmithExt/ExplorerCommand.cpp index fabd02d951..e0eee3d781 100644 --- a/src/modules/FileLocksmith/FileLocksmithExt/ExplorerCommand.cpp +++ b/src/modules/FileLocksmith/FileLocksmithExt/ExplorerCommand.cpp @@ -1,12 +1,13 @@ #include "pch.h" #include "ExplorerCommand.h" -#include "Constants.h" -#include "Settings.h" #include "dllmain.h" -#include "Trace.h" #include "Generated Files/resource.h" +#include "FileLocksmithLib/Constants.h" +#include "FileLocksmithLib/Settings.h" +#include "FileLocksmithLib/Trace.h" + #include #include #include @@ -284,4 +285,4 @@ HRESULT ExplorerCommand::LaunchUI(CMINVOKECOMMANDINFO* pici, ipc::Writer* writer CloseHandle(processInformation.hThread); return S_OK; -} +} \ No newline at end of file diff --git a/src/modules/FileLocksmith/FileLocksmithExt/ExplorerCommand.h b/src/modules/FileLocksmith/FileLocksmithExt/ExplorerCommand.h index dda50f9949..d59f266157 100644 --- a/src/modules/FileLocksmith/FileLocksmithExt/ExplorerCommand.h +++ b/src/modules/FileLocksmith/FileLocksmithExt/ExplorerCommand.h @@ -2,7 +2,7 @@ #include "pch.h" -#include "IPC.h" +#include "FileLocksmithLib/IPC.h" #define EXPLORER_COMMAND_UUID_STR "84d68575-e186-46ad-b0cb-baeb45ee29c0" diff --git a/src/modules/FileLocksmith/FileLocksmithExt/FileLocksmithExt.vcxproj b/src/modules/FileLocksmith/FileLocksmithExt/FileLocksmithExt.vcxproj index e9186c86a5..969658a40a 100644 --- a/src/modules/FileLocksmith/FileLocksmithExt/FileLocksmithExt.vcxproj +++ b/src/modules/FileLocksmith/FileLocksmithExt/FileLocksmithExt.vcxproj @@ -1,35 +1,9 @@ - + - - - Debug - ARM64 - - - Debug - Win32 - - - Release - ARM64 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - 16.0 Win32Proj @@ -39,39 +13,13 @@ PowerToys.FileLocksmithExt - + DynamicLibrary true v143 Unicode - - DynamicLibrary - false - v143 - true - Unicode - - - DynamicLibrary - true - v143 - Unicode - - - DynamicLibrary - true - v143 - Unicode - - - DynamicLibrary - false - v143 - true - Unicode - - + DynamicLibrary false v143 @@ -83,33 +31,18 @@ - - - - - - - - - - - - - - - - + - + Level3 true WIN32;_DEBUG;FILELOCKSMITHEXT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) true Use - ../../;../../../;%(AdditionalIncludeDirectories) + ..;../../;../../../;%(AdditionalIncludeDirectories) Windows @@ -118,7 +51,7 @@ dll.def - + Level3 true @@ -127,79 +60,7 @@ WIN32;NDEBUG;FILELOCKSMITHEXT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) true Use - ../../;../../../;%(AdditionalIncludeDirectories) - - - Windows - true - true - true - false - dll.def - - - - - Level3 - true - _DEBUG;FILELOCKSMITHEXT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - Use - ../../;../../../;%(AdditionalIncludeDirectories) - - - Windows - true - false - dll.def - - - - - Level3 - true - _DEBUG;FILELOCKSMITHEXT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - Use - ../../;../../../;%(AdditionalIncludeDirectories) - - - Windows - true - false - dll.def - - - - - Level3 - true - true - true - NDEBUG;FILELOCKSMITHLIB_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - Use - ../../;../../../;%(AdditionalIncludeDirectories) - - - Windows - true - true - true - false - dll.def - - - - - Level3 - true - true - true - NDEBUG;FILELOCKSMITHLIB_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - Use - ../../;../../../;%(AdditionalIncludeDirectories) + ..;../../;../../../;%(AdditionalIncludeDirectories) Windows @@ -212,16 +73,11 @@ - - - - - @@ -234,18 +90,10 @@ - - Create - Create - Create - Create - Create - Create + Create - - @@ -260,17 +108,20 @@ {98537082-0fdb-40de-abd8-0dc5a4269bab} + + {9d52fd25-ef90-4f9a-a015-91efc5daf54f} + - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/src/modules/FileLocksmith/FileLocksmithExt/FileLocksmithExt.vcxproj.filters b/src/modules/FileLocksmith/FileLocksmithExt/FileLocksmithExt.vcxproj.filters index d0a249143f..c3b4f47ebc 100644 --- a/src/modules/FileLocksmith/FileLocksmithExt/FileLocksmithExt.vcxproj.filters +++ b/src/modules/FileLocksmith/FileLocksmithExt/FileLocksmithExt.vcxproj.filters @@ -21,27 +21,12 @@ Header Files - - Header Files - Header Files Header Files - - Header Files - - - Header Files - - - Header Files - - - Header Files - @@ -59,15 +44,6 @@ Source Files - - Source Files - - - Source Files - - - Source Files - diff --git a/src/modules/FileLocksmith/FileLocksmithExt/PowerToysModule.cpp b/src/modules/FileLocksmith/FileLocksmithExt/PowerToysModule.cpp index 2c06bc403b..ee692603d2 100644 --- a/src/modules/FileLocksmith/FileLocksmithExt/PowerToysModule.cpp +++ b/src/modules/FileLocksmith/FileLocksmithExt/PowerToysModule.cpp @@ -5,12 +5,15 @@ #include #include #include +#include +#include #include -#include "Constants.h" +#include "FileLocksmithLib/Constants.h" +#include "FileLocksmithLib/Settings.h" +#include "FileLocksmithLib/Trace.h" + #include "dllmain.h" -#include "Settings.h" -#include "Trace.h" #include "Generated Files/resource.h" class FileLocksmithModule : public PowertoyModuleIface @@ -74,6 +77,18 @@ public: virtual void enable() override { Logger::info(L"File Locksmith enabled"); + + if (package::IsWin11OrGreater()) + { + std::wstring path = get_module_folderpath(globals::instance); + std::wstring packageUri = path + L"\\FileLocksmithContextMenuPackage.msix"; + + if (!package::IsPackageRegistered(constants::nonlocalizable::ContextMenuPackageName)) + { + package::RegisterSparsePackage(path, packageUri); + } + } + m_enabled = true; save_settings(); } diff --git a/src/modules/FileLocksmith/FileLocksmithExt/dllmain.cpp b/src/modules/FileLocksmith/FileLocksmithExt/dllmain.cpp index 934139da95..e2a5adcc25 100644 --- a/src/modules/FileLocksmith/FileLocksmithExt/dllmain.cpp +++ b/src/modules/FileLocksmith/FileLocksmithExt/dllmain.cpp @@ -5,7 +5,8 @@ #pragma comment(lib, "shlwapi") #include "ClassFactory.h" -#include "Trace.h" + +#include "FileLocksmithLib/Trace.h" namespace globals { diff --git a/src/modules/FileLocksmith/FileLocksmithExt/packages.config b/src/modules/FileLocksmith/FileLocksmithExt/packages.config index 47bae1882f..09bfc449e2 100644 --- a/src/modules/FileLocksmith/FileLocksmithExt/packages.config +++ b/src/modules/FileLocksmith/FileLocksmithExt/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/modules/FileLocksmith/FileLocksmithExt/Constants.h b/src/modules/FileLocksmith/FileLocksmithLib/Constants.h similarity index 90% rename from src/modules/FileLocksmith/FileLocksmithExt/Constants.h rename to src/modules/FileLocksmith/FileLocksmithLib/Constants.h index d6ac9c9b73..98a141831b 100644 --- a/src/modules/FileLocksmith/FileLocksmithExt/Constants.h +++ b/src/modules/FileLocksmith/FileLocksmithLib/Constants.h @@ -28,6 +28,9 @@ namespace constants::nonlocalizable // Name of the file where the list of files to checked will be stored constexpr WCHAR LastRunPath[] = L"\\last-run.log"; + + // Name of the tier 1 context menu package + constexpr WCHAR ContextMenuPackageName[] = L"FileLocksmithContextMenu"; } // Macros, non-localizable diff --git a/src/modules/FileLocksmith/FileLocksmithLib/FileLocksmithLib.cpp b/src/modules/FileLocksmith/FileLocksmithLib/FileLocksmithLib.cpp new file mode 100644 index 0000000000..aa0124ea70 --- /dev/null +++ b/src/modules/FileLocksmith/FileLocksmithLib/FileLocksmithLib.cpp @@ -0,0 +1,10 @@ +// FileLocksmithLib.cpp : Defines the functions for the static library. +// + +#include "pch.h" +#include "framework.h" + +// TODO: This is an example of a library function +void fnFileLocksmithLib() +{ +} diff --git a/src/modules/FileLocksmith/FileLocksmithLib/FileLocksmithLib.vcxproj b/src/modules/FileLocksmith/FileLocksmithLib/FileLocksmithLib.vcxproj new file mode 100644 index 0000000000..3e3ecc8756 --- /dev/null +++ b/src/modules/FileLocksmith/FileLocksmithLib/FileLocksmithLib.vcxproj @@ -0,0 +1,86 @@ + + + + 17.0 + Win32Proj + {9d52fd25-ef90-4f9a-a015-91efc5daf54f} + FileLocksmithLib + 10.0 + + + + StaticLibrary + true + v143 + Unicode + + + StaticLibrary + false + v143 + Unicode + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + true + Use + ../../..;../..; + + + + + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + true + Use + ../../..;../..; + + + + + true + true + true + + + + + + + + + + + + + + + + + Create + + + + + + \ No newline at end of file diff --git a/src/modules/FileLocksmith/FileLocksmithLib/FileLocksmithLib.vcxproj.filters b/src/modules/FileLocksmith/FileLocksmithLib/FileLocksmithLib.vcxproj.filters new file mode 100644 index 0000000000..8b223a619b --- /dev/null +++ b/src/modules/FileLocksmith/FileLocksmithLib/FileLocksmithLib.vcxproj.filters @@ -0,0 +1,54 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + \ No newline at end of file diff --git a/src/modules/FileLocksmith/FileLocksmithExt/IPC.cpp b/src/modules/FileLocksmith/FileLocksmithLib/IPC.cpp similarity index 100% rename from src/modules/FileLocksmith/FileLocksmithExt/IPC.cpp rename to src/modules/FileLocksmith/FileLocksmithLib/IPC.cpp diff --git a/src/modules/FileLocksmith/FileLocksmithExt/IPC.h b/src/modules/FileLocksmith/FileLocksmithLib/IPC.h similarity index 93% rename from src/modules/FileLocksmith/FileLocksmithExt/IPC.h rename to src/modules/FileLocksmith/FileLocksmithLib/IPC.h index 6013c0fa4d..44ae5f451c 100644 --- a/src/modules/FileLocksmith/FileLocksmithExt/IPC.h +++ b/src/modules/FileLocksmith/FileLocksmithLib/IPC.h @@ -2,6 +2,8 @@ #include "pch.h" +#include + namespace ipc { class Writer diff --git a/src/modules/FileLocksmith/FileLocksmithExt/Settings.cpp b/src/modules/FileLocksmith/FileLocksmithLib/Settings.cpp similarity index 100% rename from src/modules/FileLocksmith/FileLocksmithExt/Settings.cpp rename to src/modules/FileLocksmith/FileLocksmithLib/Settings.cpp diff --git a/src/modules/FileLocksmith/FileLocksmithExt/Settings.h b/src/modules/FileLocksmith/FileLocksmithLib/Settings.h similarity index 100% rename from src/modules/FileLocksmith/FileLocksmithExt/Settings.h rename to src/modules/FileLocksmith/FileLocksmithLib/Settings.h diff --git a/src/modules/FileLocksmith/FileLocksmithExt/Trace.cpp b/src/modules/FileLocksmith/FileLocksmithLib/Trace.cpp similarity index 100% rename from src/modules/FileLocksmith/FileLocksmithExt/Trace.cpp rename to src/modules/FileLocksmith/FileLocksmithLib/Trace.cpp diff --git a/src/modules/FileLocksmith/FileLocksmithExt/Trace.h b/src/modules/FileLocksmith/FileLocksmithLib/Trace.h similarity index 100% rename from src/modules/FileLocksmith/FileLocksmithExt/Trace.h rename to src/modules/FileLocksmith/FileLocksmithLib/Trace.h diff --git a/src/modules/FileLocksmith/FileLocksmithLib/framework.h b/src/modules/FileLocksmith/FileLocksmithLib/framework.h new file mode 100644 index 0000000000..71cd6b7eaa --- /dev/null +++ b/src/modules/FileLocksmith/FileLocksmithLib/framework.h @@ -0,0 +1,15 @@ +#pragma once + +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers + +#include +#include +#include +#include +#include + +// C++ Standard library +#include +#include +#include +#include diff --git a/src/modules/FileLocksmith/FileLocksmithLib/pch.cpp b/src/modules/FileLocksmith/FileLocksmithLib/pch.cpp new file mode 100644 index 0000000000..64b7eef6d6 --- /dev/null +++ b/src/modules/FileLocksmith/FileLocksmithLib/pch.cpp @@ -0,0 +1,5 @@ +// pch.cpp: source file corresponding to the pre-compiled header + +#include "pch.h" + +// When you are using pre-compiled headers, this source file is necessary for compilation to succeed. diff --git a/src/modules/FileLocksmith/FileLocksmithLib/pch.h b/src/modules/FileLocksmith/FileLocksmithLib/pch.h new file mode 100644 index 0000000000..885d5d62e4 --- /dev/null +++ b/src/modules/FileLocksmith/FileLocksmithLib/pch.h @@ -0,0 +1,13 @@ +// pch.h: This is a precompiled header file. +// Files listed below are compiled only once, improving build performance for future builds. +// This also affects IntelliSense performance, including code completion and many code browsing features. +// However, files listed here are ALL re-compiled if any one of them is updated between builds. +// Do not add files here that you will be updating frequently as this negates the performance advantage. + +#ifndef PCH_H +#define PCH_H + +// add headers that you want to pre-compile here +#include "framework.h" + +#endif //PCH_H diff --git a/src/modules/FileLocksmith/FileLocksmithLibInterop/interop.cpp b/src/modules/FileLocksmith/FileLocksmithLibInterop/interop.cpp index cc0fce4a79..e208adafcf 100644 --- a/src/modules/FileLocksmith/FileLocksmithLibInterop/interop.cpp +++ b/src/modules/FileLocksmith/FileLocksmithLibInterop/interop.cpp @@ -2,7 +2,7 @@ #include "FileLocksmith.h" -#include "../FileLocksmithExt/Constants.h" +#include "../FileLocksmithLib/Constants.h" namespace FileLocksmith::Interop { diff --git a/src/modules/Hosts/Hosts/HostsXAML/Views/MainPage.xaml b/src/modules/Hosts/Hosts/HostsXAML/Views/MainPage.xaml index c7b9023cb8..8c5b744fb5 100644 --- a/src/modules/Hosts/Hosts/HostsXAML/Views/MainPage.xaml +++ b/src/modules/Hosts/Hosts/HostsXAML/Views/MainPage.xaml @@ -76,9 +76,23 @@ - - - diff --git a/src/modules/colorPicker/ColorPickerUI/Controls/ColorFormatControl.xaml.cs b/src/modules/colorPicker/ColorPickerUI/Controls/ColorFormatControl.xaml.cs index 73eb876d57..f21973fe49 100644 --- a/src/modules/colorPicker/ColorPickerUI/Controls/ColorFormatControl.xaml.cs +++ b/src/modules/colorPicker/ColorPickerUI/Controls/ColorFormatControl.xaml.cs @@ -4,6 +4,7 @@ using System; using System.Globalization; +using System.Linq; using System.Windows; using System.Windows.Automation.Peers; using System.Windows.Controls; @@ -111,10 +112,11 @@ namespace ColorPicker.Controls return; } - var peer = UIElementAutomationPeer.FromElement(clipboardNotification); + var innerTextBlock = ((StackPanel)clipboardNotification).Children.OfType().FirstOrDefault(); + var peer = UIElementAutomationPeer.FromElement(innerTextBlock); if (peer == null) { - peer = UIElementAutomationPeer.CreatePeerForElement(clipboardNotification); + peer = UIElementAutomationPeer.CreatePeerForElement(innerTextBlock); } peer.RaiseAutomationEvent(AutomationEvents.MenuOpened); diff --git a/src/modules/colorPicker/ColorPickerUI/Controls/ColorPickerControl.xaml b/src/modules/colorPicker/ColorPickerUI/Controls/ColorPickerControl.xaml index dc522149db..220eabae1d 100644 --- a/src/modules/colorPicker/ColorPickerUI/Controls/ColorPickerControl.xaml +++ b/src/modules/colorPicker/ColorPickerUI/Controls/ColorPickerControl.xaml @@ -1,457 +1,392 @@ - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + - + + + + + + diff --git a/src/modules/colorPicker/ColorPickerUI/Controls/ColorPickerControl.xaml.cs b/src/modules/colorPicker/ColorPickerUI/Controls/ColorPickerControl.xaml.cs index b7fbdbc67a..ef1e074297 100644 --- a/src/modules/colorPicker/ColorPickerUI/Controls/ColorPickerControl.xaml.cs +++ b/src/modules/colorPicker/ColorPickerUI/Controls/ColorPickerControl.xaml.cs @@ -13,8 +13,8 @@ using System.Windows.Media; using System.Windows.Media.Animation; using ColorPicker.Helpers; using ManagedCommon; -using ModernWpf.Controls; -using ModernWpf.Controls.Primitives; +using Wpf.Ui.Controls; +using static System.Net.Mime.MediaTypeNames; namespace ColorPicker.Controls { @@ -74,9 +74,9 @@ namespace ColorPicker.Controls control._ignoreRGBChanges = true; control.HexCode.Text = ColorToHex(newColor); - control.RNumberBox.Text = newColor.R.ToString(CultureInfo.InvariantCulture); - control.GNumberBox.Text = newColor.G.ToString(CultureInfo.InvariantCulture); - control.BNumberBox.Text = newColor.B.ToString(CultureInfo.InvariantCulture); + control.RNumberBox.Value = newColor.R; + control.GNumberBox.Value = newColor.G; + control.BNumberBox.Value = newColor.B; control.SetColorFromTextBoxes(System.Drawing.Color.FromArgb(newColor.R, newColor.G, newColor.B)); control._ignoreRGBChanges = false; @@ -173,9 +173,9 @@ namespace ColorPicker.Controls if (!_ignoreRGBChanges) { - RNumberBox.Text = currentColor.R.ToString(CultureInfo.InvariantCulture); - GNumberBox.Text = currentColor.G.ToString(CultureInfo.InvariantCulture); - BNumberBox.Text = currentColor.B.ToString(CultureInfo.InvariantCulture); + RNumberBox.Value = currentColor.R; + GNumberBox.Value = currentColor.G; + BNumberBox.Value = currentColor.B; } _currentColor = currentColor; @@ -193,17 +193,17 @@ namespace ColorPicker.Controls { _isCollapsed = false; - var resizeColor = new DoubleAnimation(349, new Duration(TimeSpan.FromMilliseconds(250))); + var resizeColor = new DoubleAnimation(256, new Duration(TimeSpan.FromMilliseconds(250))); resizeColor.EasingFunction = new ExponentialEase() { EasingMode = EasingMode.EaseInOut }; var moveColor = new ThicknessAnimation(new Thickness(0), new Duration(TimeSpan.FromMilliseconds(250))); moveColor.EasingFunction = new ExponentialEase() { EasingMode = EasingMode.EaseInOut }; - ControlHelper.SetCornerRadius(CurrentColorButton, new CornerRadius(2)); - CurrentColorButton.BeginAnimation(Button.WidthProperty, resizeColor); - CurrentColorButton.BeginAnimation(Button.MarginProperty, moveColor); + CurrentColorButton.BeginAnimation(System.Windows.Controls.Button.HeightProperty, resizeColor); + CurrentColorButton.BeginAnimation(System.Windows.Controls.Button.MarginProperty, moveColor); CurrentColorButton.IsEnabled = false; SessionEventHelper.Event.EditorAdjustColorOpened = true; + DetailsFlyout.IsOpen = true; } } @@ -216,19 +216,17 @@ namespace ColorPicker.Controls var resizeColor = new DoubleAnimation(165, new Duration(TimeSpan.FromMilliseconds(150))); resizeColor.EasingFunction = new ExponentialEase() { EasingMode = EasingMode.EaseInOut }; - var moveColor = new ThicknessAnimation(new Thickness(92, 0, 0, 0), new Duration(TimeSpan.FromMilliseconds(150))); + var moveColor = new ThicknessAnimation(new Thickness(0, 72, 0, 72), new Duration(TimeSpan.FromMilliseconds(150))); moveColor.EasingFunction = new ExponentialEase() { EasingMode = EasingMode.EaseInOut }; - ControlHelper.SetCornerRadius(CurrentColorButton, new CornerRadius(0)); - CurrentColorButton.BeginAnimation(Button.WidthProperty, resizeColor); - CurrentColorButton.BeginAnimation(Button.MarginProperty, moveColor); + CurrentColorButton.BeginAnimation(System.Windows.Controls.Button.HeightProperty, resizeColor); + CurrentColorButton.BeginAnimation(System.Windows.Controls.Button.MarginProperty, moveColor); CurrentColorButton.IsEnabled = true; } } private void OKButton_Click(object sender, RoutedEventArgs e) { - HideDetails(); SelectedColorChangedCommand.Execute(_currentColor); SessionEventHelper.Event.EditorColorAdjusted = true; DetailsFlyout.Hide(); @@ -253,7 +251,7 @@ namespace ColorPicker.Controls private void ColorVariationButton_Click(object sender, RoutedEventArgs e) { - var selectedColor = ((SolidColorBrush)((Button)sender).Background).Color; + var selectedColor = ((SolidColorBrush)((System.Windows.Controls.Button)sender).Background).Color; SelectedColorChangedCommand.Execute(selectedColor); SessionEventHelper.Event.EditorSimilarColorPicked = true; } @@ -284,7 +282,7 @@ namespace ColorPicker.Controls private void HexCode_TextChanged(object sender, TextChangedEventArgs e) { - var newValue = (sender as TextBox).Text; + var newValue = (sender as System.Windows.Controls.TextBox).Text; // support hex with 3 and 6 characters and optional with hashtag var reg = new Regex("^#?([0-9A-Fa-f]{3}){1,2}$"); @@ -362,9 +360,11 @@ namespace ColorPicker.Controls if (!_ignoreRGBChanges) { var numberBox = sender as NumberBox; - var r = numberBox.Name == "RNumberBox" ? GetValueFromNumberBox(numberBox) : (byte)RNumberBox.Value; - var g = numberBox.Name == "GNumberBox" ? GetValueFromNumberBox(numberBox) : (byte)GNumberBox.Value; - var b = numberBox.Name == "BNumberBox" ? GetValueFromNumberBox(numberBox) : (byte)BNumberBox.Value; + + byte r = numberBox.Name == "RNumberBox" ? GetValueFromNumberBox(numberBox) : (byte)RNumberBox.Value; + byte g = numberBox.Name == "GNumberBox" ? GetValueFromNumberBox(numberBox) : (byte)GNumberBox.Value; + byte b = numberBox.Name == "BNumberBox" ? GetValueFromNumberBox(numberBox) : (byte)BNumberBox.Value; + _ignoreRGBChanges = true; SetColorFromTextBoxes(System.Drawing.Color.FromArgb(r, g, b)); _ignoreRGBChanges = false; @@ -379,11 +379,12 @@ namespace ColorPicker.Controls /// Validated value as per numberbox conditions, if content is invalid it returns previous value private static byte GetValueFromNumberBox(NumberBox numberBox) { - var internalTextBox = GetChildOfType(numberBox); - var parsedValue = numberBox.NumberFormatter.ParseDouble(internalTextBox.Text); + double? parsedValue = ParseDouble(numberBox.Text); + if (parsedValue != null) { var parsedValueByte = (byte)parsedValue; + if (parsedValueByte >= numberBox.Minimum && parsedValueByte <= numberBox.Maximum) { return parsedValueByte; @@ -394,6 +395,16 @@ namespace ColorPicker.Controls return (byte)numberBox.Value; } + public static double? ParseDouble(string text) + { + if (double.TryParse(text, out double result)) + { + return result; + } + + return null; + } + public static T GetChildOfType(DependencyObject depObj) where T : DependencyObject { diff --git a/src/modules/colorPicker/ColorPickerUI/Helpers/AppStateHandler.cs b/src/modules/colorPicker/ColorPickerUI/Helpers/AppStateHandler.cs index e438fee69d..f52c717a10 100644 --- a/src/modules/colorPicker/ColorPickerUI/Helpers/AppStateHandler.cs +++ b/src/modules/colorPicker/ColorPickerUI/Helpers/AppStateHandler.cs @@ -150,7 +150,7 @@ namespace ColorPicker.Helpers if (_colorEditorWindow == null) { _colorEditorWindow = new ColorEditorWindow(this); - _colorEditorWindow.Content = _colorEditorViewModel; + _colorEditorWindow.contentPresenter.Content = _colorEditorViewModel; _colorEditorViewModel.OpenColorPickerRequested += ColorEditorViewModel_OpenColorPickerRequested; _colorEditorViewModel.OpenSettingsRequested += ColorEditorViewModel_OpenSettingsRequested; _colorEditorViewModel.OpenColorPickerRequested += (object sender, EventArgs e) => diff --git a/src/modules/colorPicker/ColorPickerUI/Helpers/ControlHelper.cs b/src/modules/colorPicker/ColorPickerUI/Helpers/ControlHelper.cs new file mode 100644 index 0000000000..d56732000c --- /dev/null +++ b/src/modules/colorPicker/ColorPickerUI/Helpers/ControlHelper.cs @@ -0,0 +1,317 @@ +// 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.Windows; +using System.Windows.Controls; +using System.Windows.Media; + +namespace ColorPicker.Helpers +{ + public static class ControlHelper + { + /// + /// Gets the radius for the corners of the control's border. + /// + /// The element from which to read the property value. + /// + /// The degree to which the corners are rounded, expressed as values of the CornerRadius + /// structure. + /// + public static CornerRadius GetCornerRadius(Control control) + { + return (CornerRadius)control.GetValue(CornerRadiusProperty); + } + + /// + /// Sets the radius for the corners of the control's border. + /// + /// The element on which to set the attached property. + /// The property value to set. + public static void SetCornerRadius(Control control, CornerRadius value) + { + control.SetValue(CornerRadiusProperty, value); + } + + /// + /// Identifies the CornerRadius dependency property. + /// + public static readonly DependencyProperty CornerRadiusProperty = + DependencyProperty.RegisterAttached( + "CornerRadius", + typeof(CornerRadius), + typeof(ControlHelper), + null); + + /// + /// Identifies the Header dependency property. + /// + public static readonly DependencyProperty HeaderProperty = + DependencyProperty.RegisterAttached( + "Header", + typeof(object), + typeof(ControlHelper), + new FrameworkPropertyMetadata(OnHeaderChanged)); + + /// + /// Gets the content for the control's header. + /// + /// The element from which to read the property value. + /// The content of the control's header. The default is **null**. + public static object GetHeader(Control control) + { + return control.GetValue(HeaderProperty); + } + + /// + /// Sets the content for the control's header. + /// + /// The element on which to set the attached property. + /// The property value to set. + public static void SetHeader(Control control, object value) + { + control.SetValue(HeaderProperty, value); + } + + private static void OnHeaderChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + UpdateHeaderVisibility((Control)d); + } + + /// + /// Identifies the HeaderTemplate dependency property. + /// + public static readonly DependencyProperty HeaderTemplateProperty = + DependencyProperty.RegisterAttached( + "HeaderTemplate", + typeof(DataTemplate), + typeof(ControlHelper), + new FrameworkPropertyMetadata(OnHeaderTemplateChanged)); + + /// + /// Gets the DataTemplate used to display the content of the control's header. + /// + /// The element from which to read the property value. + /// + /// The template that specifies the visualization of the header object. The default + /// is **null**. + /// + public static DataTemplate GetHeaderTemplate(Control control) + { + return (DataTemplate)control.GetValue(HeaderTemplateProperty); + } + + /// + /// Sets the DataTemplate used to display the content of the control's header. + /// + /// The element on which to set the attached property. + /// The property value to set. + public static void SetHeaderTemplate(Control control, DataTemplate value) + { + control.SetValue(HeaderTemplateProperty, value); + } + + private static void OnHeaderTemplateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + UpdateHeaderVisibility((Control)d); + } + + private static readonly DependencyPropertyKey HeaderVisibilityPropertyKey = + DependencyProperty.RegisterAttachedReadOnly( + "HeaderVisibility", + typeof(Visibility), + typeof(ControlHelper), + new FrameworkPropertyMetadata(Visibility.Collapsed)); + + public static readonly DependencyProperty HeaderVisibilityProperty = + HeaderVisibilityPropertyKey.DependencyProperty; + + public static Visibility GetHeaderVisibility(Control control) + { + return (Visibility)control.GetValue(HeaderVisibilityProperty); + } + + private static void SetHeaderVisibility(Control control, Visibility value) + { + control.SetValue(HeaderVisibilityPropertyKey, value); + } + + private static void UpdateHeaderVisibility(Control control) + { + Visibility visibility; + + if (GetHeaderTemplate(control) != null) + { + visibility = Visibility.Visible; + } + else + { + visibility = IsNullOrEmptyString(GetHeader(control)) ? Visibility.Collapsed : Visibility.Visible; + } + + SetHeaderVisibility(control, visibility); + } + + /// + /// Gets the text that is displayed in the control until the value is changed + /// by a user action or some other operation. + /// + /// The element from which to read the property value. + /// + /// The text that is displayed in the control when no value is entered. The default + /// is an empty string (""). + /// + public static string GetPlaceholderText(Control control) + { + return (string)control.GetValue(PlaceholderTextProperty); + } + + /// + /// Sets the text that is displayed in the control until the value is changed + /// by a user action or some other operation. + /// + /// The element on which to set the attached property. + /// The property value to set. + public static void SetPlaceholderText(Control control, string value) + { + control.SetValue(PlaceholderTextProperty, value); + } + + /// + /// Identifies the PlaceholderText dependency property. + /// + public static readonly DependencyProperty PlaceholderTextProperty = + DependencyProperty.RegisterAttached( + "PlaceholderText", + typeof(string), + typeof(ControlHelper), + new FrameworkPropertyMetadata(string.Empty, OnPlaceholderTextChanged)); + + private static void OnPlaceholderTextChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + UpdatePlaceholderTextVisibility((Control)d); + } + + public static Visibility GetPlaceholderTextVisibility(Control control) + { + return (Visibility)control.GetValue(PlaceholderTextVisibilityProperty); + } + + private static void SetPlaceholderTextVisibility(Control control, Visibility value) + { + control.SetValue(PlaceholderTextVisibilityPropertyKey, value); + } + + private static readonly DependencyPropertyKey PlaceholderTextVisibilityPropertyKey = + DependencyProperty.RegisterAttachedReadOnly( + "PlaceholderTextVisibility", + typeof(Visibility), + typeof(ControlHelper), + new FrameworkPropertyMetadata(Visibility.Collapsed)); + + public static readonly DependencyProperty PlaceholderTextVisibilityProperty = + PlaceholderTextVisibilityPropertyKey.DependencyProperty; + + private static void UpdatePlaceholderTextVisibility(Control control) + { + SetPlaceholderTextVisibility(control, string.IsNullOrEmpty(GetPlaceholderText(control)) ? Visibility.Collapsed : Visibility.Visible); + } + + /// + /// Gets a brush that describes the color of placeholder text. + /// + /// The element from which to read the property value. + /// The brush that describes the color of placeholder text. + public static Brush GetPlaceholderForeground(Control control) + { + return (Brush)control.GetValue(PlaceholderForegroundProperty); + } + + /// + /// Sets a brush that describes the color of placeholder text. + /// + /// The element on which to set the attached property. + /// The property value to set. + public static void SetPlaceholderForeground(Control control, Brush value) + { + control.SetValue(PlaceholderForegroundProperty, value); + } + + /// + /// Identifies the PlaceholderForeground dependency property. + /// + public static readonly DependencyProperty PlaceholderForegroundProperty = + DependencyProperty.RegisterAttached( + "PlaceholderForeground", + typeof(Brush), + typeof(ControlHelper), + null); + + /// + /// Gets content that is shown below the control. The content should provide + /// guidance about the input expected by the control. + /// + /// The element from which to read the property value. + /// The content to be displayed below the control. The default is **null**. + public static object GetDescription(Control control) + { + return control.GetValue(DescriptionProperty); + } + + /// + /// Sets content that is shown below the control. The content should provide + /// guidance about the input expected by the control. + /// + /// The element on which to set the attached property. + /// The property value to set. + public static void SetDescription(Control control, object value) + { + control.SetValue(DescriptionProperty, value); + } + + /// + /// Identifies the Description dependency property. + /// + public static readonly DependencyProperty DescriptionProperty = + DependencyProperty.RegisterAttached( + "Description", + typeof(object), + typeof(ControlHelper), + new FrameworkPropertyMetadata(OnDescriptionChanged)); + + private static void OnDescriptionChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + UpdateDescriptionVisibility((Control)d); + } + + private static readonly DependencyPropertyKey DescriptionVisibilityPropertyKey = + DependencyProperty.RegisterAttachedReadOnly( + "DescriptionVisibility", + typeof(Visibility), + typeof(ControlHelper), + new FrameworkPropertyMetadata(Visibility.Collapsed)); + + public static readonly DependencyProperty DescriptionVisibilityProperty = + DescriptionVisibilityPropertyKey.DependencyProperty; + + public static Visibility GetDescriptionVisibility(Control control) + { + return (Visibility)control.GetValue(DescriptionVisibilityProperty); + } + + private static void SetDescriptionVisibility(Control control, Visibility value) + { + control.SetValue(DescriptionVisibilityPropertyKey, value); + } + + private static void UpdateDescriptionVisibility(Control control) + { + SetDescriptionVisibility(control, IsNullOrEmptyString(GetDescription(control)) ? Visibility.Collapsed : Visibility.Visible); + } + + internal static bool IsNullOrEmptyString(object obj) + { + return obj == null || (obj is string s && string.IsNullOrEmpty(s)); + } + } +} diff --git a/src/modules/colorPicker/ColorPickerUI/MainWindow.xaml b/src/modules/colorPicker/ColorPickerUI/MainWindow.xaml index 208e1fcda0..6aa90ae58e 100644 --- a/src/modules/colorPicker/ColorPickerUI/MainWindow.xaml +++ b/src/modules/colorPicker/ColorPickerUI/MainWindow.xaml @@ -1,24 +1,29 @@ - + - - + + - + diff --git a/src/modules/colorPicker/ColorPickerUI/MainWindow.xaml.cs b/src/modules/colorPicker/ColorPickerUI/MainWindow.xaml.cs index c3df6f54c7..d25357c99f 100644 --- a/src/modules/colorPicker/ColorPickerUI/MainWindow.xaml.cs +++ b/src/modules/colorPicker/ColorPickerUI/MainWindow.xaml.cs @@ -6,6 +6,7 @@ using System.ComponentModel.Composition; using System.Windows; using System.Windows.Interop; using ColorPicker.ViewModelContracts; +using Wpf.Ui.Controls; namespace ColorPicker { @@ -18,6 +19,7 @@ namespace ColorPicker { Closing += MainWindow_Closing; Bootstrapper.InitializeContainer(this); + Wpf.Ui.Appearance.SystemThemeWatcher.Watch(this, WindowBackdropType.None); InitializeComponent(); DataContext = this; Show(); // Call show just to make sure source is initialized at startup. diff --git a/src/modules/colorPicker/ColorPickerUI/Properties/Resources.Designer.cs b/src/modules/colorPicker/ColorPickerUI/Properties/Resources.Designer.cs index 005f23cd01..674e05bf45 100644 --- a/src/modules/colorPicker/ColorPickerUI/Properties/Resources.Designer.cs +++ b/src/modules/colorPicker/ColorPickerUI/Properties/Resources.Designer.cs @@ -141,6 +141,15 @@ namespace ColorPicker.Properties { } } + /// + /// Looks up a localized string similar to Color Picker. + /// + public static string CP_Title { + get { + return ResourceManager.GetString("CP_Title", resourceCulture); + } + } + /// /// Looks up a localized string similar to Color dark 1. /// @@ -231,6 +240,15 @@ namespace ColorPicker.Properties { } } + /// + /// Looks up a localized string similar to Pick. + /// + public static string New_Label { + get { + return ResourceManager.GetString("New_Label", resourceCulture); + } + } + /// /// Looks up a localized string similar to Press the Color Picker icon to capture a color from your screen.. /// diff --git a/src/modules/colorPicker/ColorPickerUI/Properties/Resources.resx b/src/modules/colorPicker/ColorPickerUI/Properties/Resources.resx index fa0776b451..31d9777e7c 100644 --- a/src/modules/colorPicker/ColorPickerUI/Properties/Resources.resx +++ b/src/modules/colorPicker/ColorPickerUI/Properties/Resources.resx @@ -400,4 +400,12 @@ Plum Plum color + + Pick + Button label to pick a new color + + + Color Picker + Do not translate product name + \ No newline at end of file diff --git a/src/modules/colorPicker/ColorPickerUI/Resources/Styles.xaml b/src/modules/colorPicker/ColorPickerUI/Resources/Styles.xaml index 6f6c811c50..720fbce43c 100644 --- a/src/modules/colorPicker/ColorPickerUI/Resources/Styles.xaml +++ b/src/modules/colorPicker/ColorPickerUI/Resources/Styles.xaml @@ -1,55 +1,59 @@ - - + + - - - - + + + + - + + + + + + + + + + - - - - - + + + + + + + ColorCopiedNotificationBorder="{Binding ElementName=CopiedBorderIndicator}" + ColorFormatModel="{Binding}" + SelectedColor="{Binding ElementName=colorEditorControl, Path=DataContext.SelectedColor}" /> + Margin="0,14,12,10" + Background="Transparent" + Orientation="Vertical" /> - - + - + - - - - - + + + + - - - - - - + + + + + + + + diff --git a/src/modules/colorPicker/ColorPickerUI/Views/ColorEditorView.xaml.cs b/src/modules/colorPicker/ColorPickerUI/Views/ColorEditorView.xaml.cs index ba17e3be86..3d026a0276 100644 --- a/src/modules/colorPicker/ColorPickerUI/Views/ColorEditorView.xaml.cs +++ b/src/modules/colorPicker/ColorPickerUI/Views/ColorEditorView.xaml.cs @@ -42,11 +42,13 @@ namespace ColorPicker.Views }; } - private void HistoryColors_ItemClick(object sender, ModernWpf.Controls.ItemClickEventArgs e) + /* + private void HistoryColors_ItemClick(object sender, ItemClickEventArgs e) { // Note: it does not handle clicking on the same color. // More appropriate event would be SelectionChanged but we can not distinguish between user action and program action inside of it. SessionEventHelper.Event.EditorHistoryColorPicked = true; } + */ } } diff --git a/src/modules/colorPicker/ColorPickerUI/Views/MainView.xaml b/src/modules/colorPicker/ColorPickerUI/Views/MainView.xaml index c4dda22413..cbf4aa1179 100644 --- a/src/modules/colorPicker/ColorPickerUI/Views/MainView.xaml +++ b/src/modules/colorPicker/ColorPickerUI/Views/MainView.xaml @@ -1,20 +1,23 @@ - + - - + + - + - - + + - + - + - + - - + + - - + + - + Grid.RowSpan="2" + Margin="1" + HorizontalAlignment="Stretch" + VerticalAlignment="Stretch" + Background="{Binding ColorBrush}" + BorderBrush="{DynamicResource SurfaceStrokeColorDefaultBrush}" + BorderThickness="1" + CornerRadius="{DynamicResource ControlCornerRadius}" /> - + - + diff --git a/src/modules/colorPicker/ColorPickerUI/Views/ZoomView.xaml b/src/modules/colorPicker/ColorPickerUI/Views/ZoomView.xaml index 0fadecf7ae..ec3af48220 100644 --- a/src/modules/colorPicker/ColorPickerUI/Views/ZoomView.xaml +++ b/src/modules/colorPicker/ColorPickerUI/Views/ZoomView.xaml @@ -1,62 +1,68 @@ - + - - + + - + - - + + - + - - - + + + - diff --git a/src/modules/fancyzones/FancyZones/FancyZones.vcxproj b/src/modules/fancyzones/FancyZones/FancyZones.vcxproj index 643aad98cf..a26e00dcb1 100644 --- a/src/modules/fancyzones/FancyZones/FancyZones.vcxproj +++ b/src/modules/fancyzones/FancyZones/FancyZones.vcxproj @@ -2,7 +2,7 @@ - + true @@ -160,15 +160,15 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/src/modules/fancyzones/FancyZones/packages.config b/src/modules/fancyzones/FancyZones/packages.config index 2c654a3e7d..ff4b059648 100644 --- a/src/modules/fancyzones/FancyZones/packages.config +++ b/src/modules/fancyzones/FancyZones/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/src/modules/fancyzones/FancyZonesLib/FancyZonesLib.vcxproj b/src/modules/fancyzones/FancyZonesLib/FancyZonesLib.vcxproj index d2e5b1ca43..e3be24801a 100644 --- a/src/modules/fancyzones/FancyZonesLib/FancyZonesLib.vcxproj +++ b/src/modules/fancyzones/FancyZonesLib/FancyZonesLib.vcxproj @@ -1,6 +1,6 @@ - + @@ -154,15 +154,15 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/src/modules/fancyzones/FancyZonesLib/packages.config b/src/modules/fancyzones/FancyZonesLib/packages.config index 2c654a3e7d..ff4b059648 100644 --- a/src/modules/fancyzones/FancyZonesLib/packages.config +++ b/src/modules/fancyzones/FancyZonesLib/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/src/modules/fancyzones/FancyZonesModuleInterface/FancyZonesModuleInterface.vcxproj b/src/modules/fancyzones/FancyZonesModuleInterface/FancyZonesModuleInterface.vcxproj index 12a82f47e2..4d0f7fbece 100644 --- a/src/modules/fancyzones/FancyZonesModuleInterface/FancyZonesModuleInterface.vcxproj +++ b/src/modules/fancyzones/FancyZonesModuleInterface/FancyZonesModuleInterface.vcxproj @@ -1,6 +1,6 @@ - + 15.0 {48804216-2A0E-4168-A6D8-9CD068D14227} @@ -69,7 +69,7 @@ - + @@ -77,8 +77,8 @@ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/src/modules/fancyzones/FancyZonesModuleInterface/packages.config b/src/modules/fancyzones/FancyZonesModuleInterface/packages.config index 2c654a3e7d..ff4b059648 100644 --- a/src/modules/fancyzones/FancyZonesModuleInterface/packages.config +++ b/src/modules/fancyzones/FancyZonesModuleInterface/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/src/modules/fancyzones/FancyZonesTests/UnitTests/UnitTests.vcxproj b/src/modules/fancyzones/FancyZonesTests/UnitTests/UnitTests.vcxproj index 160abae1fa..685c63ca17 100644 --- a/src/modules/fancyzones/FancyZonesTests/UnitTests/UnitTests.vcxproj +++ b/src/modules/fancyzones/FancyZonesTests/UnitTests/UnitTests.vcxproj @@ -1,6 +1,6 @@ - + 16.0 {9C6A7905-72D4-4BF5-B256-ABFDAEF68AE9} @@ -85,15 +85,15 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/src/modules/fancyzones/FancyZonesTests/UnitTests/packages.config b/src/modules/fancyzones/FancyZonesTests/UnitTests/packages.config index 2c654a3e7d..ff4b059648 100644 --- a/src/modules/fancyzones/FancyZonesTests/UnitTests/packages.config +++ b/src/modules/fancyzones/FancyZonesTests/UnitTests/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/src/modules/imageresizer/ImageResizerContextMenu/ImageResizerContextMenu.vcxproj b/src/modules/imageresizer/ImageResizerContextMenu/ImageResizerContextMenu.vcxproj index c8d8268489..bd62017a6c 100644 --- a/src/modules/imageresizer/ImageResizerContextMenu/ImageResizerContextMenu.vcxproj +++ b/src/modules/imageresizer/ImageResizerContextMenu/ImageResizerContextMenu.vcxproj @@ -1,6 +1,6 @@ - + @@ -120,15 +120,15 @@ MakeAppx.exe pack /d . /p $(OutDir)ImageResizerContextMenuPackage.msix /nv - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/src/modules/imageresizer/ImageResizerContextMenu/packages.config b/src/modules/imageresizer/ImageResizerContextMenu/packages.config index 2c654a3e7d..ff4b059648 100644 --- a/src/modules/imageresizer/ImageResizerContextMenu/packages.config +++ b/src/modules/imageresizer/ImageResizerContextMenu/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/src/modules/imageresizer/dll/ImageResizerExt.vcxproj b/src/modules/imageresizer/dll/ImageResizerExt.vcxproj index d8ae785f46..e669a76994 100644 --- a/src/modules/imageresizer/dll/ImageResizerExt.vcxproj +++ b/src/modules/imageresizer/dll/ImageResizerExt.vcxproj @@ -1,6 +1,6 @@  - + @@ -138,13 +138,13 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/src/modules/imageresizer/dll/packages.config b/src/modules/imageresizer/dll/packages.config index 47bae1882f..09bfc449e2 100644 --- a/src/modules/imageresizer/dll/packages.config +++ b/src/modules/imageresizer/dll/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/modules/imageresizer/ui/App.xaml b/src/modules/imageresizer/ui/App.xaml index 27b50ccee3..d177d900e6 100644 --- a/src/modules/imageresizer/ui/App.xaml +++ b/src/modules/imageresizer/ui/App.xaml @@ -18,6 +18,7 @@ + \ No newline at end of file diff --git a/src/modules/imageresizer/ui/Models/ResizeFit.cs b/src/modules/imageresizer/ui/Models/ResizeFit.cs index 74073f1ea0..6f880114a9 100644 --- a/src/modules/imageresizer/ui/Models/ResizeFit.cs +++ b/src/modules/imageresizer/ui/Models/ResizeFit.cs @@ -1,6 +1,7 @@ // 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/ +// See the LICENSE file in the project root for more information. +// Code forked from Brice Lambson's https://github.com/bricelam/ImageResizer/ namespace ImageResizer.Models { diff --git a/src/modules/imageresizer/ui/Models/ResizeSize.cs b/src/modules/imageresizer/ui/Models/ResizeSize.cs index 761f59adf2..e200d729c9 100644 --- a/src/modules/imageresizer/ui/Models/ResizeSize.cs +++ b/src/modules/imageresizer/ui/Models/ResizeSize.cs @@ -1,6 +1,7 @@ // 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/ +// See the LICENSE file in the project root for more information. +// Code forked from Brice Lambson's https://github.com/bricelam/ImageResizer/ using System.Collections.Generic; using System.Diagnostics; diff --git a/src/modules/imageresizer/ui/Models/ResizeUnit.cs b/src/modules/imageresizer/ui/Models/ResizeUnit.cs index f3c6a59dc2..13ef1f63df 100644 --- a/src/modules/imageresizer/ui/Models/ResizeUnit.cs +++ b/src/modules/imageresizer/ui/Models/ResizeUnit.cs @@ -1,6 +1,7 @@ // 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/ +// See the LICENSE file in the project root for more information. +// Code forked from Brice Lambson's https://github.com/bricelam/ImageResizer/ namespace ImageResizer.Models { diff --git a/src/modules/imageresizer/ui/Properties/Resources.Designer.cs b/src/modules/imageresizer/ui/Properties/Resources.Designer.cs index 3b0ac8807b..4d89835deb 100644 --- a/src/modules/imageresizer/ui/Properties/Resources.Designer.cs +++ b/src/modules/imageresizer/ui/Properties/Resources.Designer.cs @@ -87,15 +87,6 @@ namespace ImageResizer.Properties { } } - /// - /// Looks up a localized string similar to H. - /// - public static string HeightChar { - get { - return ResourceManager.GetString("HeightChar", resourceCulture); - } - } - /// /// Looks up a localized string similar to Image Resizer. /// @@ -142,7 +133,7 @@ namespace ImageResizer.Properties { } /// - /// Looks up a localized string similar to Ign_ore the orientation of pictures. + /// Looks up a localized string similar to Ignore the _orientation of pictures. /// public static string Input_IgnoreOrientation { get { @@ -151,7 +142,7 @@ namespace ImageResizer.Properties { } /// - /// Looks up a localized string similar to Remove metadata that doesn't affect rendering. + /// Looks up a localized string similar to Remove meta_data that doesn't affect rendering. /// public static string Input_RemoveMetadata { get { @@ -160,7 +151,7 @@ namespace ImageResizer.Properties { } /// - /// Looks up a localized string similar to R_esize the original pictures (don't create copies). + /// Looks up a localized string similar to Over_write files. /// public static string Input_Replace { get { @@ -519,15 +510,6 @@ namespace ImageResizer.Properties { } } - /// - /// Looks up a localized string similar to Times Symbol. - /// - public static string Times_Symbol { - get { - return ResourceManager.GetString("Times_Symbol", resourceCulture); - } - } - /// /// Looks up a localized string similar to Unit. /// @@ -563,14 +545,5 @@ namespace ImageResizer.Properties { return ResourceManager.GetString("Width", resourceCulture); } } - - /// - /// Looks up a localized string similar to W. - /// - public static string WidthChar { - get { - return ResourceManager.GetString("WidthChar", resourceCulture); - } - } } } diff --git a/src/modules/imageresizer/ui/Properties/Resources.resx b/src/modules/imageresizer/ui/Properties/Resources.resx index 50ee6864ec..313db96558 100644 --- a/src/modules/imageresizer/ui/Properties/Resources.resx +++ b/src/modules/imageresizer/ui/Properties/Resources.resx @@ -140,13 +140,13 @@ Custom - Ign_ore the orientation of pictures + Ignore the _orientation of pictures Gif files with animations may not be correctly resized. - R_esize the original pictures (don't create copies) + Ov_erwrite files Resize @@ -189,33 +189,43 @@ About {0} hour, {1} minute remaining. + "About" = Approximately, not "on the subject of" About {0} hour, {1} minutes remaining. + "About" = Approximately, not "on the subject of" About {0} hours, {1} minute remaining. + "About" = Approximately, not "on the subject of" About {0} hours, {1} minutes remaining. + "About" = Approximately, not "on the subject of" About {1} minute, {2} second remaining. + "About" = Approximately, not "on the subject of" About {1} minute, {2} seconds remaining. + "About" = Approximately, not "on the subject of" About {1} minutes, {2} second remaining. + "About" = Approximately, not "on the subject of" About {1} minutes, {2} seconds remaining. + "About" = Approximately, not "on the subject of" About {2} second remaining. + "About" = Approximately, not "on the subject of" About {2} seconds remaining. + "About" = Approximately, not "on the subject of" Fill @@ -262,9 +272,6 @@ Small - - Times Symbol - Unit @@ -281,14 +288,6 @@ Settings - Remove metadata that doesn't affect rendering - - - H - First character of 'Height' - - - W - First character of 'Width' + Remove meta_data that doesn't affect rendering \ No newline at end of file diff --git a/src/modules/imageresizer/ui/ViewModels/InputViewModel.cs b/src/modules/imageresizer/ui/ViewModels/InputViewModel.cs index 5290e28573..7466ec45b1 100644 --- a/src/modules/imageresizer/ui/ViewModels/InputViewModel.cs +++ b/src/modules/imageresizer/ui/ViewModels/InputViewModel.cs @@ -57,9 +57,9 @@ namespace ImageResizer.ViewModels public Settings Settings { get; } - public IEnumerable ResizeFitValues { get => Enum.GetValues(typeof(ResizeFit)).Cast(); } + public IEnumerable ResizeFitValues => Enum.GetValues(typeof(ResizeFit)).Cast(); - public IEnumerable ResizeUnitValues { get => Enum.GetValues(typeof(ResizeUnit)).Cast(); } + public IEnumerable ResizeUnitValues => Enum.GetValues(typeof(ResizeUnit)).Cast(); public ICommand ResizeCommand { get; } @@ -69,14 +69,9 @@ namespace ImageResizer.ViewModels public ICommand EnterKeyPressedCommand { get; private set; } - public bool TryingToResizeGifFiles - { - get - { - // Any of the files is a gif. - return _batch.Files.Any(filename => filename.EndsWith(".gif", System.StringComparison.InvariantCultureIgnoreCase)); - } - } + // Any of the files is a gif + public bool TryingToResizeGifFiles => + _batch.Files.Any(filename => filename.EndsWith(".gif", System.StringComparison.InvariantCultureIgnoreCase)); public void Resize() { diff --git a/src/modules/imageresizer/ui/Views/ResizeUnitConverter.cs b/src/modules/imageresizer/ui/Views/EnumToIntConverter.cs similarity index 52% rename from src/modules/imageresizer/ui/Views/ResizeUnitConverter.cs rename to src/modules/imageresizer/ui/Views/EnumToIntConverter.cs index 5484c3c468..fcfd151c77 100644 --- a/src/modules/imageresizer/ui/Views/ResizeUnitConverter.cs +++ b/src/modules/imageresizer/ui/Views/EnumToIntConverter.cs @@ -4,28 +4,18 @@ using System; using System.Globalization; +using System.Windows; using System.Windows.Data; -using ImageResizer.Models; -using ImageResizer.Properties; namespace ImageResizer.Views { - [ValueConversion(typeof(ResizeUnit), typeof(string))] - internal class ResizeUnitConverter : IValueConverter + [ValueConversion(typeof(Enum), typeof(int))] + internal class EnumToIntConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - var output = Resources.ResourceManager.GetString(Enum.GetName(typeof(ResizeUnit), value), culture); - - if ((string)parameter == "ToLower") - { - output = output.ToLower(culture); - } - - return output; - } + => (int)value; public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - => throw new NotImplementedException(); + => targetType.GetEnumValues().GetValue((int)value); } } diff --git a/src/modules/imageresizer/ui/Views/EnumValueConverter.cs b/src/modules/imageresizer/ui/Views/EnumValueConverter.cs index 4eb0abdd25..c95b69b295 100644 --- a/src/modules/imageresizer/ui/Views/EnumValueConverter.cs +++ b/src/modules/imageresizer/ui/Views/EnumValueConverter.cs @@ -1,6 +1,7 @@ // 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/ +// See the LICENSE file in the project root for more information. +// Code forked from Brice Lambson's https://github.com/bricelam/ImageResizer/ using System; using System.Globalization; @@ -16,6 +17,11 @@ namespace ImageResizer.Views public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { var type = value?.GetType(); + if (!type.IsEnum) + { + return value; + } + var builder = new StringBuilder(); builder diff --git a/src/modules/imageresizer/ui/Views/InputPage.xaml b/src/modules/imageresizer/ui/Views/InputPage.xaml index 0b90254fd0..f219c830c8 100644 --- a/src/modules/imageresizer/ui/Views/InputPage.xaml +++ b/src/modules/imageresizer/ui/Views/InputPage.xaml @@ -9,15 +9,16 @@ - + + - + - - - + + + @@ -76,7 +64,7 @@ - + @@ -90,15 +78,13 @@ BorderBrush="{DynamicResource CardStrokeColorDefaultBrush}" BorderThickness="0,1,0,0" /> - + + - + - + @@ -107,19 +93,17 @@ - - - - - + SelectedIndex="{Binding ElementName=SizeComboBox, Path=SelectedValue.Fit, Mode=TwoWay, Converter={StaticResource EnumToIntConverter}}"> - - + + @@ -193,76 +172,75 @@ - + SelectedIndex="{Binding ElementName=SizeComboBox, Path=SelectedValue.Unit, Mode=TwoWay, Converter={StaticResource EnumToIntConverter}}"> - - + + - + + + + + + - + + + + + - - - + + + + + - + + + + + + + + + + @@ -271,30 +249,26 @@ - + + - + @@ -307,8 +281,6 @@ Content="{x:Static p:Resources.Cancel}" IsCancel="True" /> - - diff --git a/src/modules/imageresizer/ui/Views/InputPage.xaml.cs b/src/modules/imageresizer/ui/Views/InputPage.xaml.cs index c22f74bdc2..4999e2610f 100644 --- a/src/modules/imageresizer/ui/Views/InputPage.xaml.cs +++ b/src/modules/imageresizer/ui/Views/InputPage.xaml.cs @@ -1,13 +1,13 @@ // 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/ +// See the LICENSE file in the project root for more information. +// Code forked from Brice Lambson's https://github.com/bricelam/ImageResizer/ using System.Windows.Controls; using System.Windows.Input; using ImageResizer.ViewModels; using Wpf.Ui.Controls; using static ImageResizer.ViewModels.InputViewModel; -using Numberbox = Wpf.Ui.Controls.NumberBox; namespace ImageResizer.Views { @@ -29,10 +29,9 @@ namespace ImageResizer.Views if (e.Key == Key.Enter) { var numberBox = sender as NumberBox; - var viewModel = (InputViewModel)this.DataContext; - double number; + var viewModel = (InputViewModel)DataContext; KeyPressParams keyParams; - if (double.TryParse(((System.Windows.Controls.TextBox)e.OriginalSource).Text, out number)) + if (double.TryParse(((System.Windows.Controls.TextBox)e.OriginalSource).Text, out double number)) { // Determine which NumberBox triggered the event based on its name switch (numberBox.Name) diff --git a/src/modules/imageresizer/ui/Views/MainWindow.xaml b/src/modules/imageresizer/ui/Views/MainWindow.xaml index 72a5120710..2ca6ca6b6c 100644 --- a/src/modules/imageresizer/ui/Views/MainWindow.xaml +++ b/src/modules/imageresizer/ui/Views/MainWindow.xaml @@ -16,6 +16,7 @@ ExtendsContentIntoTitleBar="True" Icon="/PowerToys.ImageResizer;component/Resources/ImageResizer.ico" ResizeMode="NoResize" + SizeToContent="Height" WindowCornerPreference="Default" WindowStartupLocation="CenterScreen"> @@ -58,6 +59,7 @@ + diff --git a/src/modules/imageresizer/ui/Views/ResultsPage.xaml b/src/modules/imageresizer/ui/Views/ResultsPage.xaml index 9f010df456..e84906879d 100644 --- a/src/modules/imageresizer/ui/Views/ResultsPage.xaml +++ b/src/modules/imageresizer/ui/Views/ResultsPage.xaml @@ -9,11 +9,7 @@ Margin="12,12,12,0" FontSize="16" Text="{x:Static p:Resources.Results_MainInstruction}" /> - + @@ -28,11 +24,12 @@ + - + + + + + + + + + - - - - - + + + + + - - - - - - + + + + + - - - - + + + - - - - + + + - - - - - - - + + + + - - - - + + + - - - - - - - + + + + + + - - - - - - - + + + + + + - - - - - - - + + + + + + - - - - - - - + + + + + + - - - - - - - + + + + + + - - - - - - - + + + + + + - - - - - - - + + + + + + - - diff --git a/src/modules/powerrename/PowerRenameUILib/PowerRenameXAML/MainWindow.xaml b/src/modules/powerrename/PowerRenameUILib/PowerRenameXAML/MainWindow.xaml index c3c30cbeb9..83610f1a3b 100644 --- a/src/modules/powerrename/PowerRenameUILib/PowerRenameXAML/MainWindow.xaml +++ b/src/modules/powerrename/PowerRenameUILib/PowerRenameXAML/MainWindow.xaml @@ -593,7 +593,7 @@ HorizontalAlignment="Right" VerticalAlignment="Bottom" Click="button_rename_Click" - Style="{StaticResource SplitAccentButtonStyle}"> + Style="{StaticResource AccentSplitButtonStyle}"> diff --git a/src/modules/powerrename/PowerRenameUILib/packages.config b/src/modules/powerrename/PowerRenameUILib/packages.config index 040eedefa7..f331e94090 100644 --- a/src/modules/powerrename/PowerRenameUILib/packages.config +++ b/src/modules/powerrename/PowerRenameUILib/packages.config @@ -2,7 +2,7 @@ - + diff --git a/src/modules/powerrename/dll/PowerRenameExt.vcxproj b/src/modules/powerrename/dll/PowerRenameExt.vcxproj index 7e07bca332..0e269b53f1 100644 --- a/src/modules/powerrename/dll/PowerRenameExt.vcxproj +++ b/src/modules/powerrename/dll/PowerRenameExt.vcxproj @@ -1,6 +1,6 @@  - + @@ -73,7 +73,7 @@ - + @@ -81,8 +81,8 @@ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + diff --git a/src/modules/powerrename/dll/packages.config b/src/modules/powerrename/dll/packages.config index 17131cfe2f..ecc3202cd3 100644 --- a/src/modules/powerrename/dll/packages.config +++ b/src/modules/powerrename/dll/packages.config @@ -2,5 +2,5 @@ - + \ No newline at end of file diff --git a/src/modules/powerrename/lib/PowerRenameLib.vcxproj b/src/modules/powerrename/lib/PowerRenameLib.vcxproj index d55914f19e..143f531169 100644 --- a/src/modules/powerrename/lib/PowerRenameLib.vcxproj +++ b/src/modules/powerrename/lib/PowerRenameLib.vcxproj @@ -1,6 +1,6 @@  - + {51920F1F-C28C-4ADF-8660-4238766796C2} Win32Proj @@ -76,7 +76,7 @@ - + @@ -84,8 +84,8 @@ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + diff --git a/src/modules/powerrename/lib/packages.config b/src/modules/powerrename/lib/packages.config index 17131cfe2f..ecc3202cd3 100644 --- a/src/modules/powerrename/lib/packages.config +++ b/src/modules/powerrename/lib/packages.config @@ -2,5 +2,5 @@ - + \ No newline at end of file diff --git a/src/modules/powerrename/testapp/PowerRenameTest.vcxproj b/src/modules/powerrename/testapp/PowerRenameTest.vcxproj index 21f6f06ada..edb4c22d36 100644 --- a/src/modules/powerrename/testapp/PowerRenameTest.vcxproj +++ b/src/modules/powerrename/testapp/PowerRenameTest.vcxproj @@ -1,6 +1,6 @@ - + 15.0 {A3935CF4-46C5-4A88-84D3-6B12E16E6BA2} @@ -66,7 +66,7 @@ - + @@ -74,8 +74,8 @@ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + diff --git a/src/modules/powerrename/testapp/packages.config b/src/modules/powerrename/testapp/packages.config index 17131cfe2f..ecc3202cd3 100644 --- a/src/modules/powerrename/testapp/packages.config +++ b/src/modules/powerrename/testapp/packages.config @@ -2,5 +2,5 @@ - + \ No newline at end of file diff --git a/src/modules/powerrename/unittests/PowerRenameLibUnitTests.vcxproj b/src/modules/powerrename/unittests/PowerRenameLibUnitTests.vcxproj index 2d1a18246d..542019a9ee 100644 --- a/src/modules/powerrename/unittests/PowerRenameLibUnitTests.vcxproj +++ b/src/modules/powerrename/unittests/PowerRenameLibUnitTests.vcxproj @@ -1,6 +1,6 @@ - + {2151F984-E006-4A9F-92EF-C6DDE3DC8413} Win32Proj @@ -76,7 +76,7 @@ - + @@ -84,8 +84,8 @@ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + diff --git a/src/modules/powerrename/unittests/packages.config b/src/modules/powerrename/unittests/packages.config index 17131cfe2f..ecc3202cd3 100644 --- a/src/modules/powerrename/unittests/packages.config +++ b/src/modules/powerrename/unittests/packages.config @@ -2,5 +2,5 @@ - + \ No newline at end of file diff --git a/src/modules/previewpane/GcodePreviewHandlerCpp/GcodePreviewHandlerCpp.vcxproj b/src/modules/previewpane/GcodePreviewHandlerCpp/GcodePreviewHandlerCpp.vcxproj index 094c55e6cb..8881cce555 100644 --- a/src/modules/previewpane/GcodePreviewHandlerCpp/GcodePreviewHandlerCpp.vcxproj +++ b/src/modules/previewpane/GcodePreviewHandlerCpp/GcodePreviewHandlerCpp.vcxproj @@ -1,6 +1,6 @@ - + 16.0 Win32Proj @@ -109,13 +109,13 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/src/modules/previewpane/GcodePreviewHandlerCpp/packages.config b/src/modules/previewpane/GcodePreviewHandlerCpp/packages.config index 47bae1882f..09bfc449e2 100644 --- a/src/modules/previewpane/GcodePreviewHandlerCpp/packages.config +++ b/src/modules/previewpane/GcodePreviewHandlerCpp/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/modules/previewpane/GcodeThumbnailProviderCpp/GcodeThumbnailProviderCpp.vcxproj b/src/modules/previewpane/GcodeThumbnailProviderCpp/GcodeThumbnailProviderCpp.vcxproj index 9b2e7d8b11..9e3f08dbf7 100644 --- a/src/modules/previewpane/GcodeThumbnailProviderCpp/GcodeThumbnailProviderCpp.vcxproj +++ b/src/modules/previewpane/GcodeThumbnailProviderCpp/GcodeThumbnailProviderCpp.vcxproj @@ -1,6 +1,6 @@ - + 16.0 Win32Proj @@ -106,15 +106,15 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/src/modules/previewpane/GcodeThumbnailProviderCpp/packages.config b/src/modules/previewpane/GcodeThumbnailProviderCpp/packages.config index 2c654a3e7d..ff4b059648 100644 --- a/src/modules/previewpane/GcodeThumbnailProviderCpp/packages.config +++ b/src/modules/previewpane/GcodeThumbnailProviderCpp/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/src/modules/previewpane/MarkdownPreviewHandlerCpp/MarkdownPreviewHandlerCpp.vcxproj b/src/modules/previewpane/MarkdownPreviewHandlerCpp/MarkdownPreviewHandlerCpp.vcxproj index 642ffa77a7..906194f470 100644 --- a/src/modules/previewpane/MarkdownPreviewHandlerCpp/MarkdownPreviewHandlerCpp.vcxproj +++ b/src/modules/previewpane/MarkdownPreviewHandlerCpp/MarkdownPreviewHandlerCpp.vcxproj @@ -1,6 +1,6 @@ - + @@ -118,13 +118,13 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/src/modules/previewpane/MarkdownPreviewHandlerCpp/packages.config b/src/modules/previewpane/MarkdownPreviewHandlerCpp/packages.config index 47bae1882f..09bfc449e2 100644 --- a/src/modules/previewpane/MarkdownPreviewHandlerCpp/packages.config +++ b/src/modules/previewpane/MarkdownPreviewHandlerCpp/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/modules/previewpane/MonacoPreviewHandlerCpp/MonacoPreviewHandlerCpp.vcxproj b/src/modules/previewpane/MonacoPreviewHandlerCpp/MonacoPreviewHandlerCpp.vcxproj index 3095a6f374..265c3a8c11 100644 --- a/src/modules/previewpane/MonacoPreviewHandlerCpp/MonacoPreviewHandlerCpp.vcxproj +++ b/src/modules/previewpane/MonacoPreviewHandlerCpp/MonacoPreviewHandlerCpp.vcxproj @@ -1,6 +1,6 @@ - + 16.0 Win32Proj @@ -109,13 +109,13 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/src/modules/previewpane/MonacoPreviewHandlerCpp/packages.config b/src/modules/previewpane/MonacoPreviewHandlerCpp/packages.config index 47bae1882f..09bfc449e2 100644 --- a/src/modules/previewpane/MonacoPreviewHandlerCpp/packages.config +++ b/src/modules/previewpane/MonacoPreviewHandlerCpp/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/modules/previewpane/PdfPreviewHandlerCpp/PdfPreviewHandlerCpp.vcxproj b/src/modules/previewpane/PdfPreviewHandlerCpp/PdfPreviewHandlerCpp.vcxproj index 242a7c25ca..cdf06b4431 100644 --- a/src/modules/previewpane/PdfPreviewHandlerCpp/PdfPreviewHandlerCpp.vcxproj +++ b/src/modules/previewpane/PdfPreviewHandlerCpp/PdfPreviewHandlerCpp.vcxproj @@ -1,6 +1,6 @@ - + 16.0 Win32Proj @@ -106,13 +106,13 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/src/modules/previewpane/PdfPreviewHandlerCpp/packages.config b/src/modules/previewpane/PdfPreviewHandlerCpp/packages.config index 47bae1882f..09bfc449e2 100644 --- a/src/modules/previewpane/PdfPreviewHandlerCpp/packages.config +++ b/src/modules/previewpane/PdfPreviewHandlerCpp/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/modules/previewpane/PdfThumbnailProviderCpp/PdfThumbnailProviderCpp.vcxproj b/src/modules/previewpane/PdfThumbnailProviderCpp/PdfThumbnailProviderCpp.vcxproj index fc45a56d67..0219414765 100644 --- a/src/modules/previewpane/PdfThumbnailProviderCpp/PdfThumbnailProviderCpp.vcxproj +++ b/src/modules/previewpane/PdfThumbnailProviderCpp/PdfThumbnailProviderCpp.vcxproj @@ -1,6 +1,6 @@ - + 16.0 Win32Proj @@ -106,15 +106,15 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/src/modules/previewpane/PdfThumbnailProviderCpp/packages.config b/src/modules/previewpane/PdfThumbnailProviderCpp/packages.config index 2c654a3e7d..ff4b059648 100644 --- a/src/modules/previewpane/PdfThumbnailProviderCpp/packages.config +++ b/src/modules/previewpane/PdfThumbnailProviderCpp/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/src/modules/previewpane/QoiPreviewHandlerCpp/QoiPreviewHandlerCpp.vcxproj b/src/modules/previewpane/QoiPreviewHandlerCpp/QoiPreviewHandlerCpp.vcxproj index 28307d2d30..4da8cdb196 100644 --- a/src/modules/previewpane/QoiPreviewHandlerCpp/QoiPreviewHandlerCpp.vcxproj +++ b/src/modules/previewpane/QoiPreviewHandlerCpp/QoiPreviewHandlerCpp.vcxproj @@ -1,6 +1,6 @@ - + 16.0 Win32Proj @@ -109,13 +109,13 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/src/modules/previewpane/QoiPreviewHandlerCpp/packages.config b/src/modules/previewpane/QoiPreviewHandlerCpp/packages.config index 47bae1882f..09bfc449e2 100644 --- a/src/modules/previewpane/QoiPreviewHandlerCpp/packages.config +++ b/src/modules/previewpane/QoiPreviewHandlerCpp/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/modules/previewpane/QoiThumbnailProviderCpp/QoiThumbnailProviderCpp.vcxproj b/src/modules/previewpane/QoiThumbnailProviderCpp/QoiThumbnailProviderCpp.vcxproj index ac1ae6fac5..ebfe79391b 100644 --- a/src/modules/previewpane/QoiThumbnailProviderCpp/QoiThumbnailProviderCpp.vcxproj +++ b/src/modules/previewpane/QoiThumbnailProviderCpp/QoiThumbnailProviderCpp.vcxproj @@ -1,6 +1,6 @@ - + 16.0 Win32Proj @@ -106,15 +106,15 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/src/modules/previewpane/QoiThumbnailProviderCpp/packages.config b/src/modules/previewpane/QoiThumbnailProviderCpp/packages.config index 2c654a3e7d..ff4b059648 100644 --- a/src/modules/previewpane/QoiThumbnailProviderCpp/packages.config +++ b/src/modules/previewpane/QoiThumbnailProviderCpp/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/src/modules/previewpane/StlThumbnailProviderCpp/StlThumbnailProviderCpp.vcxproj b/src/modules/previewpane/StlThumbnailProviderCpp/StlThumbnailProviderCpp.vcxproj index 337a8c4b53..e994e57665 100644 --- a/src/modules/previewpane/StlThumbnailProviderCpp/StlThumbnailProviderCpp.vcxproj +++ b/src/modules/previewpane/StlThumbnailProviderCpp/StlThumbnailProviderCpp.vcxproj @@ -1,6 +1,6 @@ - + 16.0 Win32Proj @@ -106,15 +106,15 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/src/modules/previewpane/StlThumbnailProviderCpp/packages.config b/src/modules/previewpane/StlThumbnailProviderCpp/packages.config index 2c654a3e7d..ff4b059648 100644 --- a/src/modules/previewpane/StlThumbnailProviderCpp/packages.config +++ b/src/modules/previewpane/StlThumbnailProviderCpp/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/src/modules/previewpane/SvgPreviewHandlerCpp/SvgPreviewHandlerCpp.vcxproj b/src/modules/previewpane/SvgPreviewHandlerCpp/SvgPreviewHandlerCpp.vcxproj index 94eeae7e29..56d680ce4b 100644 --- a/src/modules/previewpane/SvgPreviewHandlerCpp/SvgPreviewHandlerCpp.vcxproj +++ b/src/modules/previewpane/SvgPreviewHandlerCpp/SvgPreviewHandlerCpp.vcxproj @@ -1,6 +1,6 @@ - + 16.0 Win32Proj @@ -109,13 +109,13 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/src/modules/previewpane/SvgPreviewHandlerCpp/packages.config b/src/modules/previewpane/SvgPreviewHandlerCpp/packages.config index 47bae1882f..09bfc449e2 100644 --- a/src/modules/previewpane/SvgPreviewHandlerCpp/packages.config +++ b/src/modules/previewpane/SvgPreviewHandlerCpp/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/modules/previewpane/SvgThumbnailProviderCpp/SvgThumbnailProviderCpp.vcxproj b/src/modules/previewpane/SvgThumbnailProviderCpp/SvgThumbnailProviderCpp.vcxproj index 7eff3bdf67..cfa896cfb9 100644 --- a/src/modules/previewpane/SvgThumbnailProviderCpp/SvgThumbnailProviderCpp.vcxproj +++ b/src/modules/previewpane/SvgThumbnailProviderCpp/SvgThumbnailProviderCpp.vcxproj @@ -1,6 +1,6 @@ - + 16.0 Win32Proj @@ -106,15 +106,15 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/src/modules/previewpane/SvgThumbnailProviderCpp/packages.config b/src/modules/previewpane/SvgThumbnailProviderCpp/packages.config index 2c654a3e7d..ff4b059648 100644 --- a/src/modules/previewpane/SvgThumbnailProviderCpp/packages.config +++ b/src/modules/previewpane/SvgThumbnailProviderCpp/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/src/modules/previewpane/powerpreview/packages.config b/src/modules/previewpane/powerpreview/packages.config index 2c654a3e7d..ff4b059648 100644 --- a/src/modules/previewpane/powerpreview/packages.config +++ b/src/modules/previewpane/powerpreview/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/src/modules/previewpane/powerpreview/powerpreview.vcxproj b/src/modules/previewpane/powerpreview/powerpreview.vcxproj index 67572b3a69..682702b4e0 100644 --- a/src/modules/previewpane/powerpreview/powerpreview.vcxproj +++ b/src/modules/previewpane/powerpreview/powerpreview.vcxproj @@ -1,6 +1,6 @@ - + @@ -91,15 +91,15 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/src/modules/registrypreview/RegistryPreviewExt/RegistryPreviewExt.vcxproj b/src/modules/registrypreview/RegistryPreviewExt/RegistryPreviewExt.vcxproj index 911f2fe419..43b439b09e 100644 --- a/src/modules/registrypreview/RegistryPreviewExt/RegistryPreviewExt.vcxproj +++ b/src/modules/registrypreview/RegistryPreviewExt/RegistryPreviewExt.vcxproj @@ -1,6 +1,6 @@ - + Debug @@ -119,15 +119,15 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/src/modules/registrypreview/RegistryPreviewExt/packages.config b/src/modules/registrypreview/RegistryPreviewExt/packages.config index 2c654a3e7d..ff4b059648 100644 --- a/src/modules/registrypreview/RegistryPreviewExt/packages.config +++ b/src/modules/registrypreview/RegistryPreviewExt/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/src/modules/registrypreview/RegistryPreviewUI/MainWindow.Events.cs b/src/modules/registrypreview/RegistryPreviewUI/MainWindow.Events.cs index e8bd42563c..420b4fd01a 100644 --- a/src/modules/registrypreview/RegistryPreviewUI/MainWindow.Events.cs +++ b/src/modules/registrypreview/RegistryPreviewUI/MainWindow.Events.cs @@ -8,6 +8,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; +using System.Threading.Tasks; using CommunityToolkit.WinUI.UI.Controls; using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; @@ -59,6 +60,18 @@ namespace RegistryPreview if (textBox.ContextFlyout != null && textBox.ContextFlyout.IsOpen) { textBox.ContextFlyout.Hide(); + + // if true, the app will not close yet + args.Handled = true; + + // HACK: To fix https://github.com/microsoft/PowerToys/issues/28820, wait a bit for the close animation of the flyout to run before closing the application. + // This might be called many times if the flyout still hasn't been closed, as Window_Closed will be called again by App.Current.Exit + DispatcherQueue.TryEnqueue(async () => + { + await Task.Delay(100); + App.Current.Exit(); + }); + return; } // Save window placement diff --git a/src/modules/videoconference/VideoConferenceModule/VideoConference.vcxproj b/src/modules/videoconference/VideoConferenceModule/VideoConference.vcxproj index 7b205f7296..826ee3f2d3 100644 --- a/src/modules/videoconference/VideoConferenceModule/VideoConference.vcxproj +++ b/src/modules/videoconference/VideoConferenceModule/VideoConference.vcxproj @@ -1,6 +1,6 @@ - + 15.0 {5ABA70DE-3A3F-41F6-A1F5-D1F74F54F9BB} @@ -163,15 +163,15 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + diff --git a/src/modules/videoconference/VideoConferenceModule/packages.config b/src/modules/videoconference/VideoConferenceModule/packages.config index 2c654a3e7d..ff4b059648 100644 --- a/src/modules/videoconference/VideoConferenceModule/packages.config +++ b/src/modules/videoconference/VideoConferenceModule/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/src/modules/videoconference/VideoConferenceShared/VideoConferenceShared.vcxproj b/src/modules/videoconference/VideoConferenceShared/VideoConferenceShared.vcxproj index d720b314df..c97bb89b9a 100644 --- a/src/modules/videoconference/VideoConferenceShared/VideoConferenceShared.vcxproj +++ b/src/modules/videoconference/VideoConferenceShared/VideoConferenceShared.vcxproj @@ -1,6 +1,6 @@ - + Debug @@ -134,15 +134,15 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/src/modules/videoconference/VideoConferenceShared/packages.config b/src/modules/videoconference/VideoConferenceShared/packages.config index 2c654a3e7d..ff4b059648 100644 --- a/src/modules/videoconference/VideoConferenceShared/packages.config +++ b/src/modules/videoconference/VideoConferenceShared/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/src/runner/packages.config b/src/runner/packages.config index 2c654a3e7d..ff4b059648 100644 --- a/src/runner/packages.config +++ b/src/runner/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/src/runner/runner.vcxproj b/src/runner/runner.vcxproj index d3f1272bc4..0336716fec 100644 --- a/src/runner/runner.vcxproj +++ b/src/runner/runner.vcxproj @@ -1,6 +1,6 @@  - + @@ -126,15 +126,15 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/src/settings-ui/Settings.UI/SettingsXAML/App.xaml.cs b/src/settings-ui/Settings.UI/SettingsXAML/App.xaml.cs index 4454fa13a7..00559e4a2e 100644 --- a/src/settings-ui/Settings.UI/SettingsXAML/App.xaml.cs +++ b/src/settings-ui/Settings.UI/SettingsXAML/App.xaml.cs @@ -82,7 +82,7 @@ namespace Microsoft.PowerToys.Settings.UI { if (settingsWindow == null) { - settingsWindow = new MainWindow(IsDarkTheme()); + settingsWindow = new MainWindow(); } settingsWindow.Activate(); @@ -92,7 +92,7 @@ namespace Microsoft.PowerToys.Settings.UI settingsWindow.NavigateToSection(type); WindowHelpers.BringToForeground(settingsWindow.GetWindowHandle()); - } + } if (ensurePageIsSelected) { diff --git a/src/settings-ui/Settings.UI/SettingsXAML/Flyout/LaunchPage.xaml b/src/settings-ui/Settings.UI/SettingsXAML/Flyout/LaunchPage.xaml index c54f5a2159..0f1a241b25 100644 --- a/src/settings-ui/Settings.UI/SettingsXAML/Flyout/LaunchPage.xaml +++ b/src/settings-ui/Settings.UI/SettingsXAML/Flyout/LaunchPage.xaml @@ -5,9 +5,8 @@ xmlns:animatedVisuals="using:Microsoft.UI.Xaml.Controls.AnimatedVisuals" xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" - xmlns:local="using:Microsoft.PowerToys.Settings.UI.Flyout" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:tk7controls="using:CommunityToolkit.WinUI.UI.Controls" + xmlns:tkcontrols="using:CommunityToolkit.WinUI.Controls" xmlns:ui="using:CommunityToolkit.WinUI" xmlns:viewModels="using:Microsoft.PowerToys.Settings.UI.ViewModels" mc:Ignorable="d"> @@ -65,13 +64,13 @@ - + diff --git a/src/settings-ui/Settings.UI/SettingsXAML/MainWindow.xaml.cs b/src/settings-ui/Settings.UI/SettingsXAML/MainWindow.xaml.cs index 1ea867cbab..b3dec9c601 100644 --- a/src/settings-ui/Settings.UI/SettingsXAML/MainWindow.xaml.cs +++ b/src/settings-ui/Settings.UI/SettingsXAML/MainWindow.xaml.cs @@ -7,7 +7,6 @@ using ManagedCommon; using Microsoft.PowerLauncher.Telemetry; using Microsoft.PowerToys.Settings.UI.Helpers; using Microsoft.PowerToys.Settings.UI.Library; -using Microsoft.PowerToys.Settings.UI.OOBE.Views; using Microsoft.PowerToys.Settings.UI.Views; using Microsoft.PowerToys.Telemetry; using Microsoft.UI; @@ -41,6 +40,9 @@ namespace Microsoft.PowerToys.Settings.UI if (createHidden) { placement.ShowCmd = NativeMethods.SW_HIDE; + + // Restore the last known placement on the first activation + this.Activated += Window_Activated; } NativeMethods.SetWindowPlacement(hWnd, ref placement); @@ -213,6 +215,17 @@ namespace Microsoft.PowerToys.Settings.UI } } + private void Window_Activated(object sender, WindowActivatedEventArgs args) + { + if (args.WindowActivationState != WindowActivationState.Deactivated) + { + this.Activated -= Window_Activated; + var hWnd = WinRT.Interop.WindowNative.GetWindowHandle(this); + var placement = Utils.DeserializePlacementOrDefault(hWnd); + NativeMethods.SetWindowPlacement(hWnd, ref placement); + } + } + internal void EnsurePageIsSelected() { ShellPage.EnsurePageIsSelected(); diff --git a/src/settings-ui/Settings.UI/SettingsXAML/Views/PowerAccentPage.xaml b/src/settings-ui/Settings.UI/SettingsXAML/Views/PowerAccentPage.xaml index 93c429733f..001bab2e95 100644 --- a/src/settings-ui/Settings.UI/SettingsXAML/Views/PowerAccentPage.xaml +++ b/src/settings-ui/Settings.UI/SettingsXAML/Views/PowerAccentPage.xaml @@ -80,6 +80,7 @@ + diff --git a/src/settings-ui/Settings.UI/SettingsXAML/Views/PowerOcrPage.xaml b/src/settings-ui/Settings.UI/SettingsXAML/Views/PowerOcrPage.xaml index f73e99cb3f..5d170cdb91 100644 --- a/src/settings-ui/Settings.UI/SettingsXAML/Views/PowerOcrPage.xaml +++ b/src/settings-ui/Settings.UI/SettingsXAML/Views/PowerOcrPage.xaml @@ -56,8 +56,7 @@ DropDownOpened="TextExtractor_ComboBox_DropDownOpened" ItemsSource="{x:Bind Path=ViewModel.AvailableLanguages, Mode=OneWay}" Loaded="TextExtractor_ComboBox_Loaded" - SelectedIndex="{x:Bind Path=ViewModel.LanguageIndex, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" - SelectedValue="{Binding SelectedColorRepresentationValue, Mode=TwoWay}" /> + SelectedIndex="{x:Bind Path=ViewModel.LanguageIndex, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" /> diff --git a/src/settings-ui/Settings.UI/Strings/en-us/Resources.resw b/src/settings-ui/Settings.UI/Strings/en-us/Resources.resw index c7dee649b7..f6d745db77 100644 --- a/src/settings-ui/Settings.UI/Strings/en-us/Resources.resw +++ b/src/settings-ui/Settings.UI/Strings/en-us/Resources.resw @@ -1073,7 +1073,7 @@ File type, do not translate - .cpp, .py, .json, .xml, .csproj, ... + .txt, .cpp, .py, .json, .xml, .csproj, ... {Locked} @@ -1129,7 +1129,8 @@ Stereolithography - {Locked} + {Locked} + .stl {Locked} @@ -1151,13 +1152,16 @@ .qoi - {Locked} + {Locked} + Portable Document Format - {Locked} + {Locked} + .pdf - {Locked} + {Locked} + These settings allow you to manage your Windows File Explorer custom preview handlers. @@ -3437,6 +3441,9 @@ Activate by holding the key for the character you want to add an accent to, then Slovak + + Slovenian + Spanish @@ -3973,7 +3980,7 @@ Activate by holding the key for the character you want to add an accent to, then Preview - .cpp, .py, .json, .xml, .csproj, ... + .txt, .cpp, .py, .json, .xml, .csproj, ... Source code files (Monaco) @@ -4030,4 +4037,4 @@ Activate by holding the key for the character you want to add an accent to, then The enabled state of some thumbnail handlers is managed by your organization. - + \ No newline at end of file diff --git a/src/settings-ui/Settings.UI/ViewModels/PowerAccentViewModel.cs b/src/settings-ui/Settings.UI/ViewModels/PowerAccentViewModel.cs index 95d95e84a1..d71404c290 100644 --- a/src/settings-ui/Settings.UI/ViewModels/PowerAccentViewModel.cs +++ b/src/settings-ui/Settings.UI/ViewModels/PowerAccentViewModel.cs @@ -51,6 +51,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels "PT", "RO", "SK", + "SL", "SP", "SR", "SV", diff --git a/tools/BugReportTool/BugReportTool/BugReportTool.vcxproj b/tools/BugReportTool/BugReportTool/BugReportTool.vcxproj index 8ce7e68484..734146a663 100644 --- a/tools/BugReportTool/BugReportTool/BugReportTool.vcxproj +++ b/tools/BugReportTool/BugReportTool/BugReportTool.vcxproj @@ -1,6 +1,6 @@  - + 16.0 Win32Proj @@ -80,14 +80,14 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/tools/BugReportTool/BugReportTool/packages.config b/tools/BugReportTool/BugReportTool/packages.config index 2c654a3e7d..ff4b059648 100644 --- a/tools/BugReportTool/BugReportTool/packages.config +++ b/tools/BugReportTool/BugReportTool/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/tools/WebcamReportTool/WebcamReportTool.vcxproj b/tools/WebcamReportTool/WebcamReportTool.vcxproj index 7a56bd2082..feab9a9842 100644 --- a/tools/WebcamReportTool/WebcamReportTool.vcxproj +++ b/tools/WebcamReportTool/WebcamReportTool.vcxproj @@ -1,6 +1,6 @@  - + v143 @@ -62,14 +62,14 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/tools/WebcamReportTool/packages.config b/tools/WebcamReportTool/packages.config index 2c654a3e7d..ff4b059648 100644 --- a/tools/WebcamReportTool/packages.config +++ b/tools/WebcamReportTool/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/tools/project_template/ModuleTemplate/ModuleTemplateCompileTest.vcxproj b/tools/project_template/ModuleTemplate/ModuleTemplateCompileTest.vcxproj index b0fa518792..e9ed3777d7 100644 --- a/tools/project_template/ModuleTemplate/ModuleTemplateCompileTest.vcxproj +++ b/tools/project_template/ModuleTemplate/ModuleTemplateCompileTest.vcxproj @@ -1,6 +1,6 @@ - + 15.0 {64A80062-4D8B-4229-8A38-DFA1D7497749} @@ -110,13 +110,13 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + \ No newline at end of file diff --git a/tools/project_template/ModuleTemplate/packages.config b/tools/project_template/ModuleTemplate/packages.config index 47bae1882f..09bfc449e2 100644 --- a/tools/project_template/ModuleTemplate/packages.config +++ b/tools/project_template/ModuleTemplate/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file