PowerToys icon indicating copy to clipboard operation
PowerToys copied to clipboard

Color Picker: Add setting to disable automatic copy to clipboard

Open ThanhNguyxn opened this issue 3 weeks ago • 2 comments

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:

  1. ColorPickerProperties.cs - Added CopyColorToClipboard property with default value true
  2. IUserSettings.cs - Added interface member for the new setting
  3. UserSettings.cs - Added property implementation and settings loading
  4. MainViewModel.cs - Modified HandleMouseClickAction to check the setting before copying
  5. ColorPickerViewModel.cs - Added property binding for Settings UI
  6. ColorPickerPage.xaml - Added ToggleSwitch for the new setting
  7. 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

ThanhNguyxn avatar Dec 03 '25 09:12 ThanhNguyxn

@microsoft-github-policy-service agree

ThanhNguyxn avatar Dec 03 '25 09:12 ThanhNguyxn

@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 CVS

To 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.txt file 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.txt file.

    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.

github-actions[bot] avatar Dec 03 '25 09:12 github-actions[bot]