Color Picker: Add setting to disable automatic copy to clipboard
Summary of the Pull Request
Adds a new "Copy color to clipboard" toggle in Color Picker settings that allows users to disable the automatic copying of picked colors to clipboard. This addresses users who want to use Color Picker to identify colors without overwriting their clipboard contents.
PR Checklist
- [x] Applies to a single PowerToys application
- [x] Code builds correctly
- [x] Tests passed
- [x] Localization guidelines followed
Detailed Description of the Pull Request / Additional comments
Problem
When using Color Picker to pick a color, it automatically copies the color value to clipboard, overwriting any existing clipboard content. Some users want to identify colors without this clipboard modification behavior.
Solution
Added a new setting CopyColorToClipboard (default: true) that controls whether the picked color is automatically copied to clipboard.
Changes:
- ColorPickerProperties.cs - Added
CopyColorToClipboardproperty with default valuetrue - IUserSettings.cs - Added interface member for the new setting
- UserSettings.cs - Added property implementation and settings loading
- MainViewModel.cs - Modified
HandleMouseClickActionto check the setting before copying - ColorPickerViewModel.cs - Added property binding for Settings UI
- ColorPickerPage.xaml - Added ToggleSwitch for the new setting
- Resources.resw - Added localized strings
Behavior:
- Enabled (default): Works exactly as before - color is copied to clipboard when picked
- Disabled: Color is picked and can be viewed/edited, but clipboard is not modified
Fixes #8389
@microsoft-github-policy-service agree
@check-spelling-bot Report
:red_circle: Please review
See the :open_file_folder: files view, the :scroll:action log, or :memo: job summary for details.
Unrecognized words (1)
copycolortoclipboard
These words are not needed and should be removed
CVSTo accept these unrecognized words as correct and remove the previously acknowledged and now absent words, you could run the following commands
... in a clone of the [email protected]:ThanhNguyxn/PowerToys.git repository
on the feature/colorpicker-disable-auto-copy branch (:information_source: how do I use this?):
curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/c635c2f3f714eec2fcf27b643a1919b9a811ef2e/apply.pl' |
perl - 'https://github.com/microsoft/PowerToys/actions/runs/19888267040/attempts/1' &&
git commit -m 'Update check-spelling metadata'
If the flagged items are :exploding_head: false positives
If items relate to a ...
-
binary file (or some other file you wouldn't want to check at all).
Please add a file path to the
excludes.txtfile matching the containing file.File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.
^refers to the file's path from the root of the repository, so^README\.md$would exclude README.md (on whichever branch you're using). -
well-formed pattern.
If you can write a pattern that would match it, try adding it to the
patterns.txtfile.Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.
Note that patterns can't match multiline strings.