Draft
Conversation
Member
Author
|
Useful addition might be to add a few preset scaling factors (on the number keys?) that can be quickly selected. |
Member
Author
|
Very weird things going on here. Directly after a reboot, the measuring does not work. It only measures correctly the second time that I run pelita. Do you happen to have any idea @otizonaizit ? Screencast.From.2025-08-18.16-31-18.mp4 |
Member
Author
|
gitk is having the same problem (works fine on second open). If gitk is opened before Pelita, then all is good. |
Member
Author
|
Traced it down to being related to Wayland/Xwayland I think. If I run something like |
f2a7573 to
b686b84
Compare
This file contains hidden or 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
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.
Workable solution for #820. Still needs adjustments. Unclear, if the tk internal scaling for widgets(?)
self.root.tk.call('tk', 'scaling', xxx)will be needed.How does it work: We can use Tk to measure the pixel width of a text with a given font size. The result will be in raw pixels (on Linux). On macOS the number is resolution independent (which is good: on macOS it already works as it should). I could not test with Windows yet.
This number will then scale the geometry of the Window and then our own scaling mechanics will resize the canvas to make everything fit.
Screen is set to scale to 225%. Without the fix:
With the fix:
Note that the font and hard-coded numbers for the positioning of the header are currently not scaled, which is why they do look off. Work also needs to be done for the debug mode whose 1px grid lines look very tiny on higher scaling factors.