Skip to content

[OS X] Retina display support (NSHighResolutionCapable and image@2x) #2309

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

Closed
jacobseptember opened this issue Sep 17, 2014 · 8 comments
Closed
Labels
Component: IDE user interface The Arduino IDE's user interface feature request A request to make an enhancement (not a bug fix) OS: OSX Specific to the Mac OS X (macOS) version of the Arduino IDE

Comments

@jacobseptember
Copy link

Crossposting here and at the Google Groups page; it's not clear which one is more active.

There are two issues regarding Retina support: Text/buttons/UI in general, and high-quality images.

The "simple" text/buttons/etc issue can be addressed by adding the following to Info.plist:
<key>NSHighResolutionCapable</key> <true/>
This was apparently done with this commit in August 2012, but the version of 1.5.7 that I downloaded in August 2014 did not have this key in its Info.plist.

The images issue is a bit more complicated. I'm used to working with iOS, in which the OS will generally accept either image.png or image@2x.png (the high-resolution version). This is apparently not the case with OS X; when I try to use an image I created for the little down-triangle in the top right of the IDE, it doesn't show up at all if the filename includes the "@2x" and shows up twice as large as should be if the filename doesn't include the "@2x".
The fix here is more involved, but shouldn't be too difficult (I think). First, high-def images need to be created for the eleven images in Arduino.app/Contents/Java/lib/theme. Then, the source code needs to be modified to look for the "@2x" images as well as the regular ones, and take the correct one. I don't know exactly how this is done, and I suspect it will be more involved in Java than Obj-C. Sorry.

SEE ALSO: Google Code issue 982, Github issue 982, Github issue 2204, Google Code issue 1140

tab-unsel-menu
tab-unsel-menu@2x

@matthijskooijman matthijskooijman added Component: IDE user interface The Arduino IDE's user interface OS: OSX Specific to the Mac OS X (macOS) version of the Arduino IDE feature request A request to make an enhancement (not a bug fix) labels Sep 17, 2014
@mbrav
Copy link
Contributor

mbrav commented Oct 7, 2014

Tried adding <key>NSHighResolutionCapable</key> <true/> to the info.plist but it didn't change anything :(

@jacobseptember
Copy link
Author

You have to reload some OS cache, and I don't know of any other way of doing that than renaming Arduino.app (though I imagine there must be some other way). I renamed mine to ArduinoHD.app. And then reboot, of course.

@cmaglie
Copy link
Member

cmaglie commented Nov 7, 2014

Are you using the java6 or java7 version?

It looks like the java6 already have that flag set:
https://github.com/arduino/Arduino/blob/ide-1.5.x/build/macosx/template.app/Contents/Info.plist#L17

@jacobseptember
Copy link
Author

I'm not sure which branch of Arduino I'm using. I have Arduino 1.5.7 and Java 7 (just updated to 7 Update 71). My application's Info.plist did not come with that flag, set or not.

@dani-z
Copy link

dani-z commented Nov 9, 2014

<key>NSHighResolutionCapable</key> <true/>
Worked for me Arduino IDE Beta on Yosemite but only for the text, that was nearly unreadable before.

I don't really mind about the icons, though it would be nice to have them @2x.

Thanks @jacobseptember for the solution.

@cmaglie
Copy link
Member

cmaglie commented Dec 11, 2014

The key was present in Info.plist but missing in appbundler.jar.
Actually appbundler generates a brand new Info.plist every time the IDE is build.

BTW now it's fixed and will be available in the next release.

@jacobseptember
Copy link
Author

That's great — should be fixed for the text/UI stuff! That's 95% of the whole thing.
Are there plans to make hi-res versions of those eleven images? I could take a stab at it myself over winter break, I just don't know how they would be incorporated into the actual code.

@maximkrusina
Copy link

To refresh cache, no need to reboot Mac OS, just use in terminal:
sudo touch /Applications/Appname.app

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) OS: OSX Specific to the Mac OS X (macOS) version of the Arduino IDE
Projects
None yet
Development

No branches or pull requests

6 participants