Skip to content
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

Arduino IDE on High DPI (take 2) #4376

Merged
merged 24 commits into from Feb 9, 2016
Merged

Conversation

cmaglie
Copy link
Member

@cmaglie cmaglie commented Jan 2, 2016

This is a follow up on @PaulStoffregen's PR #2532(edit: wrong number) PR #2776

TODO / questions:

  • The font of the menus and the textarea are not scaled as the rest of the GUI. Is this because the OS scales them automatically? Otherwise we should scale them as well.
  • Add a "Scale interface for UHD displays" preference in the preferences dialog.
  • The gui.scalePercent is now a theme preference (in theme.txt) but I'm wondering if this should really be a general preference (in preferences.txt) because screen scaling doesn't seems related to the theme

@cmaglie cmaglie added feature request A request to make an enhancement (not a bug fix) Component: IDE user interface The Arduino IDE's user interface labels Jan 2, 2016
@cmaglie cmaglie self-assigned this Jan 2, 2016
@PaulStoffregen
Copy link
Sponsor Contributor

The setting in theme.txt was a simple hack meant to eventually be replaced by a proper preference or automatic detection of the screen DPI from the operating system.

@elFallino
Copy link

Font size is scaled by the operating systems decoration manager / window manager while everything else is hardcoded info the IDE.
Some things this patch is scaling could be done better by using proper Java Layout Managers (at the moment, mostly the null layout manager with fixed values for Position and size is used) , others need to be scaled (like all the bitmaps). But doing this would mean to completely rewrite the GUI.

Automatical detection of screen resolution would be nice, but there is no common way to do so for all kinds of operating systems and window managers.

A good way could be a scaling option in preferences (e.g. a slider or drowdown in 25% steps Form 75% up to 400% or so).
Scaling the bitmaps is an issue, too. If they are scaled up to 400% or worst: scaled using an odd factor like 275%, they look pretty ugly. Pauls idea for that was to switch to high res bitmaps if scaling factor exceeds, lets say, 200% (rendering vector graphics would be an alternative).

@lmihalkovic
Copy link

The path i chose for the toolbar bitmaps was to replace them with java code generated from SVGs using a tool somewhere on github (described in #4196)

@lmihalkovic
Copy link

Each platform has a way to find out their scaling ratio, and the codebase already has the Platform class to abstract this kind of underlying API differences.

@cmaglie cmaglie force-pushed the hi-res-display branch 2 times, most recently from e6d1aa1 to 17729d1 Compare January 7, 2016 11:19
@cmaglie
Copy link
Member Author

cmaglie commented Jan 7, 2016

This last version includes:

  • a new preference for setting scale that ranges from 100% to 200% (less than 100% is useless more than 200% is huuuge IMHO I see that most apps that allows interface scaling have the same range)
  • now the resource images are vectorial SVG
  • there is an "Autodetect" checkbox, this is a placeholder for an eventual future DPI-detection subroutine, for now it defaults to 100%.

Testing welcome!

/cc @00alis

@lmihalkovic
Copy link

You know that now that you converted the res to SVGs it is easy to generate java code for Icon subclasses?! Then you can cleanup the toolbar code (dont have to but it would help with making a Tool2 interface that would allow button contributions for eg) and eliminate batik (using it scale a handful of svgs is IMHO like moving the piano instead of getting the stool closer to the piano)

@elFallino
Copy link

Imagine a 15 Inc 4k (UHD) screen and 200% isn't huge. So please add some more scaling factors >200%.
There are already 5K displays and those high DPI displays will enter the consumer sector more and more.
Do not build-in unneccessary restrictions that will come up soon. ;)

@wishAI
Copy link

wishAI commented Jan 9, 2016

Unfortunally,it doesn't work on my surface pro 4 no matter how I change the "gui.scale" in the preferences.txt . Also , the links of the old versions doesn't work and I can't test it.

@cmaglie
Copy link
Member Author

cmaglie commented Jan 9, 2016

no matter how I change the "gui.scale" in the preferences.txt

uhm, that's really weird, have you tried to change the value from the preference panel instead of changing preference.txt?

@cmaglie
Copy link
Member Author

cmaglie commented Jan 9, 2016

prefs

@elFallino
Copy link

It is working for me, using preferences window (Windows 10).

@wishAI
Copy link

wishAI commented Jan 10, 2016

I change it in the panel and it works , thank you.

@choidamdam
Copy link

@cmaglie

more than 200% is huuuge

I'm using Dell Inspiron 15 7548 laptop and recommended display scaling (the default one) is 250% on Windows 10. Maximum scaling is 350% on my display settings.

@cmaglie
Copy link
Member Author

cmaglie commented Jan 12, 2016

Updated the scale range up to 400%

@jem-green
Copy link

Icon scaling works as expected while dragging the application across multiple monitors in windows 10

@jem-green
Copy link

Ok next is message windows being too small to read !
capture

@jem-green
Copy link

even smaller !
capture

@jem-green
Copy link

Double splash window at start-up is this normal?
capture

@jem-green
Copy link

And possibly finally can we scale the window size along with the preferences ?
capture

@cmaglie
Copy link
Member Author

cmaglie commented Jan 14, 2016

@jem-green thanks very much for the feedback, I'll try to address these issues!

@bonnee
Copy link

bonnee commented Jan 21, 2016

The tab bar reaches 3000px and doesn't scale higher
2016-01-21-183636_3840x2160_scrot

@cmaglie cmaglie merged commit b02ce54 into arduino:master Feb 9, 2016
@cmaglie
Copy link
Member Author

cmaglie commented Feb 9, 2016

@Sembazuru
yes, the print function needs a bit of overhaul. The issue you reported AFAIU is old and not caused by this pull-request (even if the hi-dpi patch make it worse). I see that you already opened another issue, let's continue the discussion there.

@cmaglie cmaglie deleted the hi-res-display branch February 9, 2016 16:29
@Sembazuru
Copy link

Ok. Sounds good. I just downloaded the most recent nightly (dated 2016-02-19T05:41) and the merge seems stable so far.

@jordansissel
Copy link

Success! I am using Arduino 1.6.8 and can confirm that the interface scaling preference works well for me (Windows 10)

Thank you! ❤️

@lorenzoromagnoli
Copy link

@cmaglie I can see that you added the 2x sized image,
but it doesn't seem to be used and the splash screen still looks bad on my macbook retina display.
328d3b6

@tobsen
Copy link

tobsen commented May 21, 2016

Same here on a iMac retina, I also tried the nightly.

bildschirmfoto 2016-05-21 um 15 51 55

@andypiper
Copy link

andypiper commented May 27, 2016

What's the current story with the splash screen, toolbar icons, and the text in editor tab titles on OS X? Everything else looks nice and smooth, but those items seem to be scaled from low-res? (1.6.9)

@edgimar
Copy link

edgimar commented Oct 17, 2016

I'm using version 1.6.12 of the IDE under Ubuntu 16.04 and Java 1.8.0_101. When the interface scale is set to 200%, the editor window and tab (and status window) are properly sized on my display, however, the settings window, menus, and several other dialogs are still not scaled (text is very tiny).

@avastmick
Copy link

avastmick commented May 15, 2017

Windows 10 Dell XPS 15 9550 3840x2160 resolution.

Generally the UI is fine and scales okay, but only once I set the scaling to 300% so the font size is easily readable. The pop-up screens are mangled and unusable, however. The window is not resizable and not all the items are rendered / or are heavily overlapped.

2017-05-15

Any ideas on how to be able to see pop-up screen like this?

cmaglie added a commit to cmaglie/Arduino that referenced this pull request Jul 18, 2017
facchinm pushed a commit that referenced this pull request Oct 11, 2017
facchinm pushed a commit that referenced this pull request Oct 16, 2017
cmaglie added a commit that referenced this pull request Oct 23, 2017
cmaglie added a commit that referenced this pull request Oct 30, 2017
facchinm pushed a commit that referenced this pull request Nov 10, 2017
facchinm pushed a commit that referenced this pull request Nov 15, 2017
facchinm pushed a commit that referenced this pull request Jan 11, 2018
facchinm pushed a commit that referenced this pull request Feb 16, 2018
facchinm pushed a commit that referenced this pull request Apr 12, 2018
facchinm pushed a commit that referenced this pull request May 2, 2018
@bbulkow
Copy link

bbulkow commented Jan 20, 2019

Using 1.8.8 from the windows store.

Usable but not great.

The menu items aren't scaled.

The scaling set in the Window 10 UI isn't obeyed. All my other programs look at the scale factor I have set for that monitor, so when I drag a window from monitor to monitor, it rescales according to the scale factor of that monitor.

@tobia
Copy link

tobia commented Jun 24, 2019

Does anybody have any workaround for telling Java how much to scale the default AWT elements, or whether to scale them at all?

I'm on a 125% HiDPI monitor. I have set X11's resource correctly to Xft.dpi: 120 (96 × 1.25) but Arduino (or Java) seem to detect a 200% HiDPI setting from who knows where. I fixed the main interface using the "Interface Scale" preference, but I cannot find a way to scale the menus.

Is there an environment variable, Java property, or any other hack to force the AWT scaling factor, or even to disable it at all? Given the choice, I would prefer my menus to be 20% smaller, rather than 60% bigger.

I tried both sun.java2d.uiScale and GDK_SCALE, as mentioned in Arch Linux Wiki, to no avail.

Related to #6472

arduino_menu

@s-light
Copy link

s-light commented Feb 7, 2020

found a workaround posted in #9170
basically create a custom .gtkrc-2.0 file with font size you like and start arduino with this file:
GTK2_RC_FILES=my_arduino_gtkrc-2.0.conf arduino

@Feromrk
Copy link

Feromrk commented Jun 28, 2020

the workaround from @s-light didn't work for me (manjaro linux with kde). The menu bars still stayed ultra small.
Changing GDK_SCALE as @tobia suggested worked! Note that it accepts only integer values (float doesn't work, so I had to set it to 2, instead of 1.5)

starting arduino ide with the following command now:
GDK_SCALE=2 /usr/share/arduino/arduino

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: IDE user interface The Arduino IDE's user interface feature request A request to make an enhancement (not a bug fix)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet