-
Notifications
You must be signed in to change notification settings - Fork 187
Scale Table.INSET by zoom level instead of using fixed pixels #2456
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
Scale Table.INSET by zoom level instead of using fixed pixels #2456
Conversation
Test Results 546 files ±0 546 suites ±0 32m 59s ⏱️ +43s For more details on these failures, see this check. Results for commit feb86f6. ± Comparison against base commit 508ad4a. ♻️ This comment has been updated with latest results. |
c5d338a to
0d2c14c
Compare
0d2c14c to
7c33e01
Compare
The Table.INSET constant defines the spacing in the width of a table cell. Previously, this was a fixed value of 3px, which looks correct at 100% zoom but causes the image and text to appear cramped on higher-DPI displays. This change defines INSET in points and converts it to pixels based on the current zoom level (e.g. 6px at 200%), ensuring consistent spacing across different monitor scale.
7c33e01 to
feb86f6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, as did the same changes in Tree before.
One thing I observed during testing (unrelated to this PR!) is that if I move between monitors, the scrollbars are missing on the small monitor.
My setting
- 175% monitor on the left (primary)
- 100% monitor on the right
To reproduce
Start the snippet with these VM arguments:
-Dswt.autoScale=quarter
-Dswt.autoScale.updateOnRuntime=true
Move from 175% monitor to 100% monitor.
Screenshots
Is this known? Can you please create a ticket for it if it isn't?
|
Failing test unrelated: #2516 |
It's not the scrollbar that is missing, it's the table not adapting its size upon DPI change while the shell does it. If you enlarge the shell, you will see the scrollbar. Note that this is probably the case for every control, not only for Table. |
|
@HeikoKlare I do not agree that a Layout must be used... as mentioned elsewhere sizing controls directly is absolutely valid for SWT (not that I would recommend it...)! So one would say, if no Layout is installed, the shell would probably like to scale up/down its childs, otherwise ask the layout to relayout. |
I do not find the place where I said that you must use a layout. In any case, that's not what I wanted to say. I just explained the reason for the behavior in case of this snippet. And I explained why the issue was probably not identified so far. It's of course fully valid, but given the number of users we know about that currently require non-layouted controls to adapt to DPI changes (which to my knowledge is 0), it's probably not worth to invest effort into that right now. |
|
Since the issue is unrelated, I'm merging this PR. |


The Table.INSET constant defines the spacing in the width of a table cell. Previously, this was a fixed value of 3px, which looks correct at 100% zoom but causes the image and text to appear cramped on higher-DPI displays.
This change defines INSET in points and converts it to pixels based on the current zoom level (e.g. 6px at 200%), ensuring consistent spacing across different monitor scale.
How to Test
Results:
Before Change
Width 150% = 77
Width 250% = 128
After change
Width 150% = 84
Width 250% = 139