PowerToys icon indicating copy to clipboard operation
PowerToys copied to clipboard

[Peek] Use effective pixels for unsupported previewer

Open SamChaps opened this issue 2 years ago • 2 comments

Summary of the Pull Request

Use effective pixels for unsupported previewer allowing to nicely display on any monitor scale.

PR Checklist

  • [ ] Closes: #26133
  • [ ] Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
  • [ ] 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
  • [ ] Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

  • Added PreviewSize class to support effective pixels for previewers.
  • Refactored monitor size evaluation based on scale.

Validation Steps Performed

Tested on different monitor scale.

SamChaps avatar May 26 '23 07:05 SamChaps

Hi Sam, Just checked your fix. It solves the problem with big scales. On my screen when checking the normal 100% scaling factor, the font sizes got smaller, maybe too small. Could you take a look on that? Thanks! Laszlo image

donlaci avatar May 26 '23 09:05 donlaci

Please take a look on the normal 100% scaling factor, the fonts are too small. Thanks

What is your monitor resolution? I have a 2k monitor and it looks good at 100% If your monitor is 4k and you use 100% I would expect the text to be very small just like the rest of Windows text. Text scaling should happen automatically with XAML, I don't think manually changing the font size is a viable option.

SamChaps avatar May 26 '23 17:05 SamChaps

Here is 100% at 1090x1080 image

Here is 100% at 2560x1440 image

SamChaps avatar May 26 '23 18:05 SamChaps

Hi Sam, My monitor resolution is indeed 4k. It seems like as higher the resolution is as smaller the font size gets.

donlaci avatar May 26 '23 18:05 donlaci

Hi Sam, My monitor resolution is indeed 4k. It seems like as higher the resolution is as smaller the font size gets.

Do you notice similar behavior with other apps or Peek's behavior is different?

SamChaps avatar May 26 '23 18:05 SamChaps

It was with peek only. With the new commit the preview of unsupported files looks great with any scale factor. 100%, 250%. Well done, great!

donlaci avatar May 26 '23 18:05 donlaci