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

Conversation

@cmaglie
Copy link
Member

commented Jan 2, 2016

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

  • Rebased #2532 #2776 on current master
  • Added some hi-res images for the toolbar
  • Factored out the formula to scale up dimensions

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
@PaulStoffregen

This comment has been minimized.

Copy link
Collaborator

commented Jan 2, 2016

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

This comment has been minimized.

Copy link

commented Jan 2, 2016

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

This comment has been minimized.

Copy link

commented Jan 2, 2016

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

This comment has been minimized.

Copy link

commented Jan 2, 2016

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 cmaglie:hi-res-display branch 2 times, most recently from e6d1aa1 to 17729d1 Jan 5, 2016

@cmaglie

This comment has been minimized.

Copy link
Member Author

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

This comment has been minimized.

Copy link

commented Jan 7, 2016

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

This comment has been minimized.

Copy link

commented Jan 7, 2016

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Member Author

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

This comment has been minimized.

Copy link
Member Author

commented Jan 9, 2016

prefs

@elFallino

This comment has been minimized.

Copy link

commented Jan 9, 2016

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

@wishAI

This comment has been minimized.

Copy link

commented Jan 10, 2016

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

@choidamdam

This comment has been minimized.

Copy link

commented Jan 12, 2016

@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 cmaglie force-pushed the cmaglie:hi-res-display branch from 17729d1 to 057ebfa Jan 12, 2016

@cmaglie

This comment has been minimized.

Copy link
Member Author

commented Jan 12, 2016

Updated the scale range up to 400%

@jem-green

This comment has been minimized.

Copy link

commented Jan 13, 2016

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

@jem-green

This comment has been minimized.

Copy link

commented Jan 13, 2016

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

@jem-green

This comment has been minimized.

Copy link

commented Jan 13, 2016

even smaller !
capture

@jem-green

This comment has been minimized.

Copy link

commented Jan 13, 2016

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

@jem-green

This comment has been minimized.

Copy link

commented Jan 13, 2016

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

@cmaglie

This comment has been minimized.

Copy link
Member Author

commented Jan 14, 2016

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

@Bonnee

This comment has been minimized.

Copy link

commented Jan 21, 2016

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

@Sembazuru

This comment has been minimized.

Copy link

commented Feb 3, 2016

Blink.pdf
Thank you for your hard work on adding the scaling to the user interface.
Now, if you could take it away from something... namely the scaling of the font size when printing. See the attached pdf print of the Blink.ino example. Thanx.

(Future feature request would be to add more options to the printing like line numbers, syntax highlighting, and custom headers/footers. But, that is all out of scope here.)

@DanChesher

This comment has been minimized.

Copy link

commented Feb 4, 2016

Tested arduino-PR-4376-BUILD-496-windows on a Toshiba Satellite S55t-C5325-4K, 3840x2160 resolution, Windows 10. Works great! Thanks so much for making these changes.

@cmaglie cmaglie merged commit b02ce54 into arduino:master Feb 9, 2016

@cmaglie

This comment has been minimized.

Copy link
Member Author

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 cmaglie:hi-res-display branch Feb 9, 2016

@Sembazuru

This comment has been minimized.

Copy link

commented Feb 11, 2016

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

@jordansissel

This comment has been minimized.

Copy link

commented Apr 22, 2016

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

This comment has been minimized.

Copy link

commented May 10, 2016

@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

This comment has been minimized.

Copy link

commented May 21, 2016

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

bildschirmfoto 2016-05-21 um 15 51 55

@andypiper

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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).

@s-light

This comment has been minimized.

Copy link

commented on ce3679d Jan 29, 2017

@cmaglie do you know under what license the icons are?
initial question i have is - would i iam allowed to use these icons (mainly the ones contained in buttons.svg)in an commercial closed source tutorial to explain the functionality of them?

This comment has been minimized.

Copy link
Member Author

replied Jan 30, 2017

I guess that with the current license you cannot use the icons to make a derivative work, unless you share it alike (and I deduce that your "closed source" tutorial isn't since you're asking).

BTW I think you can take screenshots without incurring in such restriction (books often uses images taken from commercial closed-source software without problems and I don't think that its considered a "derivate" work), so probably you can use the screenshots as a surrogate of the icon. Anyway, this is just my personal opinion, I'm not a lawyer and can't tell for sure ;-).

This comment has been minimized.

Copy link

replied Jan 30, 2017

thanks for your comments on this - i know that we all are not lawyers ;-)
i will go the screenshots way.. its the 'safest' way in this i think.
(good thought - from what point on is a screenshot a derivative work? ;-) )
thanks for your input!

@avastmick

This comment has been minimized.

Copy link

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 added a commit that referenced this pull request Oct 11, 2017

facchinm added 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 added a commit that referenced this pull request Nov 10, 2017

facchinm added a commit that referenced this pull request Nov 15, 2017

facchinm added a commit that referenced this pull request Jan 11, 2018

facchinm added a commit that referenced this pull request Feb 16, 2018

facchinm added a commit that referenced this pull request Apr 12, 2018

facchinm added a commit that referenced this pull request May 2, 2018

@bbulkow

This comment has been minimized.

Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.