-
Notifications
You must be signed in to change notification settings - Fork 235
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
UI scaling factor #352
Comments
That would be amazing, in particular if multiple sizes were supported inside the same GUI. For example with OS X Look-and-Feel you can do
Also Nimbus attempted to implemented this, although stupidly it got stuck in the middle, so some things work and others render badly. |
BTW regarding the forum post - I believe that on OS X you can set a system property for hi-dpi displays that will render all Swing of an application by a scaling factor of two, so as long as you use vector graphics this provides a simple means to get "normal size" widgets on a high-res screen. Not sure something like this exists on Windows and Linux (I don't have a hi-dpi screen) |
I would rather not mix it with the UI scaling as those are different things - OS X component size variations are about different variations of the same component - those variations might have slightly different predefined settings (like corners round for example) but at the same time have some common things. If you mix it with the scaling it will only create issues. Variations you are talking about can be easily achieved with the styling system introduced in next update. Actually a lot of components will already have a lot of variations included into the base style. So it will simply be a matter of a few XML lines to add more if you need them - just reduce the rounding and font size slightly, maybe adjust some colors - there you have it, new component variation which can be applied to each component of that type or to some specific components separately.
It seems that there is some kind of support on Windows 8 and 10 - when you are running Swing application it is being scaled up in size (tried on notebook with 3840 x 2160 resolution) but it actually looks horrible - UI and text is so blurry that you can barely work with the application. So I wouldn't call that a sufficient solution for the problem. And by the way, we actually ended up changing the resolution to 1920 x 1080 as Java applications aren't the only ones having issues with scaling. Plus such resolution places an enormous stress on hardware and causes some serious lags even while browsing some sites. That is slightly an off-topic but everyone I know (except OS X users) simply went back to using Full HD resolution for now even if they have higher resolutions available. |
I have actually a user of one of my applications (that uses WebLaF) that has the hi-dpi problem (things rendered too small) on Windows 8.1. Do you remember how to enable up-scaling (even if it looks bad)? And with the current 1.29 snapshot - can I specify default font size for all components perhaps? |
I didn't really enable it anyhow, it simply was there on hi-dpi screen. Probably it was enabled through reading windows UI scaling setting (which was 1.25x by default), but I might be wrong here.
All default fonts are defined within Check |
One of the possible scaling solutions could be providing different style settings for different DPI cases, maybe in the same way OS-dependant settings can be passed - through specific states. Though with OS its quite clear - you can have
Though there seem to be no good way of determining screen resolution in Java. Toolkit.getDefaultToolkit().getScreenResolution() Seem to give a hardcoded value in most cases, though I'm not completely sure about it. |
In any case, either of two concepts offered above will only be useful if fonts can be configured within styles along with the other settings. So issue #331 must be implemented first. |
I've been recently looking into possible UI scaling solutions for different OS versions and stumbled upon some issues currently present in Java 8 and 9 (also seem to be bugged on some other versions): Although I have only tested this under Windows 7, 8 and 10. |
Consider adding global UI scaling factor that will affect painting of all WebLaF components. It should probably be passed into
Painter
interface into mainpaint
method as one of the base settings to ensure painters are aware of it.Original request:
http://weblookandfeel.com/forum/viewtopic.php?f=4&t=221
The text was updated successfully, but these errors were encountered: