Files
PowerToys/src/settings-ui/Settings.UI.Library/MouseHighlighterProperties.cs
Kai Tao 16742354c4 Mouse highlighter: support a spotlight mode - inner transparent, out a backdrop (#40043)
<!-- 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

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [x] **Closes:** #15512 
- [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
- [x] **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

<!-- Describe how you validated the behavior. Add automated tests
wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed


https://github.com/user-attachments/assets/0748c526-fcf5-4859-b832-14a413d2cad1
2025-06-27 14:11:39 +08:00

62 lines
2.3 KiB
C#

// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Text.Json.Serialization;
using Settings.UI.Library.Attributes;
namespace Microsoft.PowerToys.Settings.UI.Library
{
public class MouseHighlighterProperties
{
[CmdConfigureIgnore]
public HotkeySettings DefaultActivationShortcut => new HotkeySettings(true, false, false, true, 0x48);
[JsonPropertyName("activation_shortcut")]
public HotkeySettings ActivationShortcut { get; set; }
[JsonPropertyName("left_button_click_color")]
public StringProperty LeftButtonClickColor { get; set; }
[JsonPropertyName("right_button_click_color")]
public StringProperty RightButtonClickColor { get; set; }
[JsonPropertyName("highlight_opacity")]
[CmdConfigureIgnore]
public IntProperty HighlightOpacity { get; set; }
[JsonPropertyName("always_color")]
public StringProperty AlwaysColor { get; set; }
[JsonPropertyName("highlight_radius")]
public IntProperty HighlightRadius { get; set; }
[JsonPropertyName("highlight_fade_delay_ms")]
public IntProperty HighlightFadeDelayMs { get; set; }
[JsonPropertyName("highlight_fade_duration_ms")]
public IntProperty HighlightFadeDurationMs { get; set; }
[JsonPropertyName("auto_activate")]
public BoolProperty AutoActivate { get; set; }
[JsonPropertyName("spotlight_mode")]
public BoolProperty SpotlightMode { get; set; }
public MouseHighlighterProperties()
{
ActivationShortcut = DefaultActivationShortcut;
LeftButtonClickColor = new StringProperty("#a6FFFF00");
RightButtonClickColor = new StringProperty("#a60000FF");
AlwaysColor = new StringProperty("#00FF0000");
HighlightOpacity = new IntProperty(166); // for migration from <=1.1 to 1.2
HighlightRadius = new IntProperty(20);
HighlightFadeDelayMs = new IntProperty(500);
HighlightFadeDurationMs = new IntProperty(250);
AutoActivate = new BoolProperty(false);
SpotlightMode = new BoolProperty(false);
}
}
}