Files
Niels Laute 05ba63beba [Screen Ruler] Add DIP as an extra measurement unit (#49588)
## Summary of the Pull Request

Adds display-independent pixels (DIP) to Screen Ruler's existing **Extra
units of measurement** setting. Physical pixels remain the primary
overlay value; selecting DIP adds a second, parenthesized measurement
that adjusts for Windows display scaling.

DIP values use the DPI of the monitor containing the measurement. This
also corrects the millimeter fallback conversion when physical monitor
dimensions are unavailable.


<img width="1079" height="81" alt="image"
src="https://github.com/user-attachments/assets/a34fe0a8-1dc1-4f1d-97c6-1a0dc37bf2e3"
/>

Before vs after:

<img width="921" height="617" alt="image"
src="https://github.com/user-attachments/assets/7b0ed0ce-7058-4f4f-b8ae-1fc3709e0ace"
/>


## PR Checklist

- [x] Closes #20304
- [x] Closes #46945
- [x] **Communication:** The scope was agreed before implementation
- [x] **Tests:** Added/updated and all focused tests pass
- [x] **Localization:** All end-user-facing strings can be localized
- [x] **Dev docs:** Added/updated
- [x] **New binaries:** Not applicable; no production binaries were
added
- [ ] **Documentation updated:** A public documentation PR has not been
filed

## Detailed Description of the Pull Request / Additional comments

- Preserves the existing persisted values for pixels, inches,
centimeters, and millimeters; DIP is appended as value `4`.
- Preserves the existing overlay behavior: pixels are always displayed,
with one optional extra unit on a second line.
- Preserves the existing clipboard behavior: pixel-only output has no
suffix, while a selected extra unit is copied by itself.
- Converts physical pixels to DIP using each overlay window's monitor
DPI.
- Corrects the 96-DPI millimeter fallback so 96 px equals 25.4 mm.
- Adds focused native conversion tests, settings compatibility tests,
and DIP clipboard UI coverage.
- Keeps guides, calibration, browser-relative units, and other
measurement modes out of scope.

## Validation Steps Performed

- Built `MeasureToolCore` for ARM64 Debug.
- Built `MeasureToolUI` for ARM64 Debug.
- Built PowerToys Settings for ARM64 Debug.
- Built and ran `MeasureToolCore.UnitTests`: 5 passed.
- Built and ran the Screen Ruler settings tests: 6 passed.
- Built `ScreenRuler.UITests`; local execution was not run because
WinAppDriver is not installed.
- Ran XAML Styler on the changed Settings page.

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 1a6361cf-d701-4a9b-b8e8-d5700c5ba140
2026-08-31 13:31:57 +02:00
..

PowerToys Modules

This section contains documentation for individual PowerToys modules, including their architecture, implementation details, and debugging tools.

Available Modules

Module Description
Advanced Paste Tool for enhanced clipboard pasting with formatting options
Always on Top Tool for pinning windows to stay on top of other windows
Awake Tool to keep your computer awake without modifying power settings
Color Picker Tool for selecting and managing colors from the screen
Command Not Found Tool suggesting package installations for missing commands
Crop and Lock Tool for cropping application windows into smaller windows or thumbnails
Environment Variables Tool for managing user and system environment variables
FancyZones (debugging tools) Window manager utility for custom window layouts
File Explorer add-ons Extensions for enhancing Windows File Explorer functionality
File Locksmith Tool for finding processes that lock files
Hosts File Editor Tool for managing the system hosts file
Image Resizer Tool for quickly resizing images within File Explorer
Keyboard Manager Tool for remapping keys and keyboard shortcuts
Mouse Utilities Collection of tools to enhance mouse and cursor functionality
Mouse Without Borders Tool for controlling multiple computers with a single mouse and keyboard
NewPlus Context menu extension for creating new files in File Explorer
Peek File preview utility for quick file content viewing
Power Rename Bulk file renaming tool with search and replace functionality
PowerToys Run (deprecation soon) Quick application launcher and search utility
Quick Accent Tool for quickly inserting accented characters and special symbols
Registry Preview Tool for visualizing and editing Registry files
Screen Ruler Tool for measuring pixel distances and color boundaries on screen
Shortcut Guide Tool for displaying Windows keyboard shortcuts when holding the Windows key
Text Extractor Tool for extracting text from images and screenshots
Workspaces Tool for saving and restoring window layouts for different projects
ZoomIt Screen zoom and annotation tool

Adding New Module Documentation

When adding documentation for a new module:

  1. Create a dedicated markdown file for the module (e.g., modulename.md)
  2. If the module has specialized debugging tools, consider creating a separate tools document (e.g., modulename-tools.md)
  3. Update this index with links to the new documentation
  4. Follow the existing documentation structure for consistency