mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 10:46:33 +02:00
Settings Flyout improvement (#43840)
<!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request This pull request introduces the new Quick Access feature to PowerToys by integrating its host process management into the runner and system tray. The changes add the Quick Access host implementation, update project and build files to include it, and modify the runner and tray icon logic to launch and interact with the Quick Access UI. <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist - [x] Closes: #43694 <!-- - [ ] Closes: #yyy (add separate lines for additional resolved issues) --> - [x] **Communication:** I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected - [x] **Tests:** Added/updated and all pass - [ ] **Localization:** All end-user-facing strings can be localized - [ ] **Dev docs:** Added/updated - [ ] **New binaries:** Added on the required places - [ ] [JSON for signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json) for new binaries - [ ] [WXS for installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs) for new binaries and localization folder - [ ] [YML for CI pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml) for new test projects - [ ] [YML for signed pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml) - [ ] **Documentation updated:** If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys) and link it here: #xxx <!-- Provide a more detailed description of the PR, other things fixed, or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments <img width="290" height="420" alt="image" src="https://github.com/user-attachments/assets/7390a706-171c-479f-a4a2-999b18cfc65f" /> <img width="290" height="420" alt="image" src="https://github.com/user-attachments/assets/99e99bc9-b1a3-46c6-b648-81e3048dec1b" /> <img width="490" height="350" alt="image" src="https://github.com/user-attachments/assets/2cce4ad6-a54e-4587-87b7-fdc7fba1f54f" /> <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed --------- Signed-off-by: Shawn Yuan (from Dev Box) <shuaiyuan@microsoft.com> Signed-off-by: Shuai Yuan <shuai.yuan.zju@gmail.com> Co-authored-by: Niels Laute <niels.laute@live.nl>
This commit is contained in:
@@ -7,6 +7,7 @@ using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
using ManagedCommon;
|
||||
using Microsoft.PowerToys.Settings.UI.Library.Helpers;
|
||||
using Microsoft.PowerToys.Settings.UI.Library.Interfaces;
|
||||
using Microsoft.PowerToys.Settings.UI.Library.Utilities;
|
||||
using Settings.UI.Library.Attributes;
|
||||
@@ -19,7 +20,7 @@ namespace Microsoft.PowerToys.Settings.UI.Library
|
||||
ByStatus,
|
||||
}
|
||||
|
||||
public class GeneralSettings : ISettingsConfig
|
||||
public class GeneralSettings : ISettingsConfig, IHotkeyConfig
|
||||
{
|
||||
// Gets or sets a value indicating whether run powertoys on start-up.
|
||||
[JsonPropertyName("startup")]
|
||||
@@ -48,6 +49,14 @@ namespace Microsoft.PowerToys.Settings.UI.Library
|
||||
[JsonPropertyName("enable_warnings_elevated_apps")]
|
||||
public bool EnableWarningsElevatedApps { get; set; }
|
||||
|
||||
// Gets or sets a value indicating whether Quick Access is enabled.
|
||||
[JsonPropertyName("enable_quick_access")]
|
||||
public bool EnableQuickAccess { get; set; }
|
||||
|
||||
// Gets or sets Quick Access shortcut.
|
||||
[JsonPropertyName("quick_access_shortcut")]
|
||||
public HotkeySettings QuickAccessShortcut { get; set; }
|
||||
|
||||
// Gets or sets theme Name.
|
||||
[JsonPropertyName("theme")]
|
||||
public string Theme { get; set; }
|
||||
@@ -94,6 +103,8 @@ namespace Microsoft.PowerToys.Settings.UI.Library
|
||||
ShowSysTrayIcon = true;
|
||||
IsAdmin = false;
|
||||
EnableWarningsElevatedApps = true;
|
||||
EnableQuickAccess = true;
|
||||
QuickAccessShortcut = new HotkeySettings();
|
||||
IsElevated = false;
|
||||
ShowNewUpdatesToastNotification = true;
|
||||
AutoDownloadUpdates = false;
|
||||
@@ -116,6 +127,22 @@ namespace Microsoft.PowerToys.Settings.UI.Library
|
||||
IgnoredConflictProperties = new ShortcutConflictProperties();
|
||||
}
|
||||
|
||||
public HotkeyAccessor[] GetAllHotkeyAccessors()
|
||||
{
|
||||
return new HotkeyAccessor[]
|
||||
{
|
||||
new HotkeyAccessor(
|
||||
() => QuickAccessShortcut,
|
||||
(hotkey) => { QuickAccessShortcut = hotkey; },
|
||||
"GeneralPage_QuickAccessShortcut"),
|
||||
};
|
||||
}
|
||||
|
||||
public ModuleType GetModuleType()
|
||||
{
|
||||
return ModuleType.GeneralSettings;
|
||||
}
|
||||
|
||||
// converts the current to a json string.
|
||||
public string ToJsonString()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user