Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High-DPI support #309

Merged
merged 11 commits into from
Feb 2, 2025
Merged

High-DPI support #309

merged 11 commits into from
Feb 2, 2025

Conversation

arch1t3cht
Copy link
Member

PR created to test CI and to run tests builds for users that are waiting for this.

arch1t3cht and others added 6 commits January 30, 2025 18:04
This is what Debian stable currently ships. Bumping to 3.2.2 in
particular brings a lot of improvements for high DPI support, which will
be necessary for upcoming commits.
Replace RetinaHelper with wxWidget's GetContentScaleFactor and
wxDPIChangedEvent listeners.
This is only a one-to-one replace for now. Scale factor awareness
needs to be made more consistent and the video display code could
probably be simplified to use FromPhys / ToPhys instead, but this
can be done in future commits.
This improves rendering with DPI scaling (like on Windows) and with
backends/themes with very different control dimensions (like wxGTK3).

This was crosschecked with the GUI-related commits at wangqr/Aegisub but
the actual changes are done from scratch.

Reduce the upper bounds for a few spin controls (like the layer and
resolution) since wxGTK3 will always set the minimum content size of
spin controls to fit its maximum value, which will make the spinner
buttons clip outside the control if it's sized to something smaller,
see
wxWidgets/wxWidgets#18568
@arch1t3cht arch1t3cht force-pushed the gui branch 7 times, most recently from ee82e7f to 59deebd Compare February 2, 2025 09:30
Use wxBitmapBundle to make wx handle picking the correct bitmap for any
given DPI scale. Since these are slightly more expensive to construct
(since all bitmap sizes need to be parsed), cache the results.
Unfortunately, wx doesn't allow setting a wxBitmapBundle's desired scale
or DIP display size after constructing it, so we have to construct new
bitmaps for every display size (which also makes the cache less
effective).

Since we now need to know the list of all bitmaps associated to a
certain icon as well as their sizes, make respack.py generate this
information.

Remove the mask from the color picker button - there doesn't seem to be
any special reason why it's necessary and it makes things harder with
wxBitmapBundle.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants