-
Notifications
You must be signed in to change notification settings - Fork 32
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
GUI scaling (hiDPI displays on Linux) #30
Comments
Thanks @tferr, I am using TrakEM2 in Ubuntu and somehow it looks OK? My desktop screen is 2500x1400 or something like that. The toolbar is broken, as ImageJ has changed something and TrakEM2 hasn't kept up, but that's another matter. |
That is medium resolution and workable. However, we have 3456x2160px
on a 13" screen. This is when it gets hard to see anything. FlatLaf
has very nice scalable LoFs that deal with that but it can be hard if
there are too many pixel based design decisions in the way. We just
did this for BigDataViewer and it was a bit of work.
|
Similar to my laptop. It is just not trakEM2. Lots of things in Fiji (with Java 8) are affected by this. It just makes it hard to use it out of the box. I'm going to lobby for wider FlatLaf adoption. At least having it available in Fiji would allow scripts to make Swing-based GUIs (more) scalable even after being displayed. |
@acardona, @axtimwalde It is not perfect (notice how the second row is shifted to the left), but at least one can now interact with the tools 😄 I also tried to have them scale according to whatever scaling factor is in use in IJ's Edit->Options->Appearance: If users are scaling IJ's GUI (as I am on linux), then the tools will look the same across trakEM2 and IJ. I also made that the metal L&F is only imposed when Nimbus is being used. Overall, this allows to run TrakEM2 quite well on a 4K screen on Ubuntu. This is how it looks with FlatLaf: @rasband, related: |
That's amazing! Thanks so much!
Missatge de Tiago Ferreira ***@***.***> del dia dc., 31 d’ag.
2022 a les 14:49:
… @acardona <https://github.com/acardona>, @acardona
<https://github.com/acardona>
Looked quickly at this (thanks for the tip @rasband
<https://github.com/rasband>). The toolbar was accessing a deprecaded SIZE
field in ij.gui.Toolbar. Updating it to buttonHeight seems to fix the
toolbar for the most part:
[image: Screenshot from 2022-08-31 09-03-55]
<https://user-images.githubusercontent.com/2439948/187690141-118e0445-8cca-474a-9353-bafdb650bfc6.png>
It is not perfect (notice how the second row is shifted to the left), but
at least one can now interact with the tools 😄
I also tried to have them scale according to whatever scaling factor is in
use in IJ's Edit->Options->Appearance: If users are scaling IJ's GUI (as I
am on linux), than the tools will look the same across trakEM2 and IJ. I
also made that the metal L&F is only imposed when Nimbus is being used.
Overall, this allows to run TrakEM2 quite well on a 4K screen on Ubuntu.
This is how it looks with FlatLaf:
[image: image]
<https://user-images.githubusercontent.com/2439948/187692496-eceb9e3b-f098-449f-9f22-fca764a07de2.png>
@rasband <https://github.com/rasband>, related: ij.Prefs.getGuiScale()
does not seem to be applied to the font of the contextual menus of the
toolbar icons. They remain prohibitively small to read. Would it be
possible to scale it too?
—
Reply to this email directly, view it on GitHub
<#30 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAMKGXAG5X2PAMBIWW3XT3V35PEZANCNFSM6AAAAAAQAWPMYY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hi @tferr,
You probably need to use both
I have not found a way to scale contextual menus, which are |
@rasband , ij.gui.GUI#scalePopupMenu() should do this (I cannot remember: maybe I wrote it for the PlotWindow!?). It seems to work even when it is called right after initializing the PopupMenu, e.g., If one adds this to ij.gui.Toolbar#addPopupMenus: ovalPopup = new PopupMenu();
ij.gui.GUI.scalePopupMenu(ovalPopup); The font scales properly (compare to the unscaled font from the rectangular tool -- snapshot from the same ImageJ frame): |
Hi @tferr, I had forgotten |
@rasband, I don't know why that is. I put my changes in this PR: imagej/ImageJ#173 (against the 1.53u1 base code.) It seems to work as expected on ubuntu 22.04. The PR replaces all Edit: Direct link to diff: imagej/ImageJ@f3a8638?diff=split&w=1 |
This issue has been mentioned on Image.sc Forum. There might be relevant details there: https://forum.image.sc/t/timeline-for-the-next-fiji-update/69640/7 |
Hi @tferr, Scaling of toolbar popup menus works on Linux and Windows in the ImageJ 1.53u4 daily build! The commit is at |
Line 1795 of Toolbar.java is patched in the ImageJ 1.53u5 daily build. The commit is at imagej/ImageJ@d7f396b. |
@axtimwalde, @acardona : Just so that it is not forgotten: When doing this test, i noticed the following with trakEM2 (PopOS 22.04, default Java8 bundled with Fiji):
The only way to use trakEM2 (on linux) in a somewhat comfortable manner is to rescale the screen to 1080p, which is really sad
The text was updated successfully, but these errors were encountered: