Repository navigation
Keep image picker previews sharp on HiDPI displays - #14156
Conversation
|
| sourceSize.width: Math.ceil(root.expandedWidth * Screen.devicePixelRatio) | ||
| sourceSize.height: Math.ceil(root.expandedHeight * Screen.devicePixelRatio) |
There was a problem hiding this comment.
At 200% scale, every visible preview decodes at 1536×950, even when a neighboring card is shown only as a narrow slice. On a 3840-pixel-wide display at that scale, the picker can hold about 19 decoded previews—roughly 111 MB of image buffers, four times the previous amount—and queues the larger decodes when neighbors become enabled. This is a non-blocking memory and decode-cost concern; consider limiting how many neighbors decode at full resolution while keeping the selected card sharp.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Summary
Follow-up to #14117.
The picker uses logical card dimensions for its decode size. At 200% display scale, it requests 768×475 pixels for a card that occupies 1536×950 physical pixels. This makes preview text and fine detail look soft.
Use
Screen.devicePixelRatioto request the expanded card's physical size. Round up fractional dimensions to provide enough pixels at fractional display scales. Keep the decode size stable during card transitions to avoid extra reloads.The picker retains its bounded delegate count and asynchronous image decode.
Validation
bash test/shell.d/image-picker-test.shpasses, including decode-size checks at 100%, 125%, 150%, and 200% scale.bash test/shell.d/overlay-window-test.shpasses.bash -n test/shell.d/image-picker-test.shandgit diff --checkpass.