-
Notifications
You must be signed in to change notification settings - Fork 520
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
High-DPI support #309
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
ee82e7f
to
59deebd
Compare
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.
This was referenced Feb 2, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR created to test CI and to run tests builds for users that are waiting for this.