Author Topic: CodeBlocks on retina display  (Read 15681 times)

Offline user4385re

  • Single posting newcomer
  • *
  • Posts: 7
CodeBlocks on retina display
« on: February 11, 2014, 03:46:52 pm »
Hello,

I've just installed code blocks on my retina mac and i was wondering if i could do anything about the quality of icons and code text because i can, literally, see pixels and it's just annoying ^^.

Thanks in advance =).

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: CodeBlocks on retina display
« Reply #1 on: February 11, 2014, 04:21:13 pm »
I've just installed code blocks on my retina mac and i was wondering if i could do anything about the quality of icons
You can do it yourself - its an open source project and these resources are embedded into resource ZIP files (namely resources.zip and manager_resources.zip in the "share" folder...).
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline user4385re

  • Single posting newcomer
  • *
  • Posts: 7
Re: CodeBlocks on retina display
« Reply #2 on: February 11, 2014, 04:28:28 pm »
I see, i thought that i could find a file or a piece of code directly. Although i don't know how to do it, i will try to fix the resolution of the icons. If you have any advices, i would love to read them.

Thanks.

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: CodeBlocks on retina display
« Reply #3 on: February 11, 2014, 05:19:33 pm »
@Morten: Do you know if anyone ever made an SVG icon set? That would make it a lot easier to get a consistent icon set that works across multiple resolutions.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: CodeBlocks on retina display
« Reply #4 on: February 11, 2014, 05:50:54 pm »
@Morten: Do you know if anyone ever made an SVG icon set? That would make it a lot easier to get a consistent icon set that works across multiple resolutions.
Partially its in the repo: replace trunk with resources and check it out.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline user4385re

  • Single posting newcomer
  • *
  • Posts: 7
Re: CodeBlocks on retina display
« Reply #5 on: February 11, 2014, 06:24:34 pm »
I'm truly sorry, i'm new to programming so i really don't know how to do it :(.

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: CodeBlocks on retina display
« Reply #6 on: February 11, 2014, 08:08:26 pm »
here: http://svn.code.sf.net/p/codeblocks/code/resources/

But apparently noone has made SVGs for toolbar/menu icons

Offline user4385re

  • Single posting newcomer
  • *
  • Posts: 7
Re: CodeBlocks on retina display
« Reply #7 on: February 12, 2014, 04:33:41 pm »
Thanks a lot for your reply, i will try to replace the icons, but the real problem is the resolution of the text. Is there any thing to do about that ?


Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: CodeBlocks on retina display
« Reply #8 on: February 12, 2014, 04:47:54 pm »
Thanks a lot for your reply, i will try to replace the icons, but the real problem is the resolution of the text. Is there any thing to do about that ?

Do you have a screenshot? Not sure exactly how Mac Retina works, but doesn't it do some sort of pixel doubling for apps that don't affirmatively signal that they are retina compatible?

I didn't see a lot of good info on this on wxWidgets related sites, but here's a couple

https://groups.google.com/forum/#!searchin/wx-dev/retina/wx-dev/drw37uN_TeM/dhmEJFFBtN8J
http://wiki.wxwidgets.org/WxMac-specific_topics#Retina_display_support

With regard to text rendering, the latter of those links says:

Quote
To have text rendered sharply on macs with a Retina display the key "NSPrincipalClass" should exist in the info.plist of your application. Its value seems to be irrelevant - probably it's best to just set it to the default "NSApplication".

Btw, if you try to go with double sized PNGs you will need to figure out how to inform that OS that these shouldn't be pixel doubled.

Offline user4385re

  • Single posting newcomer
  • *
  • Posts: 7
Re: CodeBlocks on retina display
« Reply #9 on: February 13, 2014, 05:16:25 pm »
Yep, here's the screenshots, i couldn't do bigger ones due to the allowed space.
The first screen is from code blocks and the second from powerpoint so to compare between them =).

There's an other problem, in mac, code blocks is not installed (we don't have a directory specific to code blocks, just the application) so i don't know how to replace the icons.

Thanks a lot for your help.


[attachment deleted by admin]

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: CodeBlocks on retina display
« Reply #10 on: February 14, 2014, 12:05:11 am »
I think the App is just a zip file, try extracting all of the files and see if you can find the Info.plist file. Then look for NSPrincipalClass key in that file (you should be able to open it in a text editor - it's just xml). If the key missing, add it and then rezip everything and see if it makes a difference. There maybe some permission issues that I'm not aware of that you will have to deal with to make the zip runnable. I don't have a mac so I'm about at the limits of what I can do to help.

You could also try replacing the image files in the extracted application, but I suspect you will not be able to improve things here because it doesn't look like wxWidgets support for retina resources is actually ready.

Offline user4385re

  • Single posting newcomer
  • *
  • Posts: 7
Re: CodeBlocks on retina display
« Reply #11 on: February 14, 2014, 12:52:44 am »
I found the file info.plist and i added <key>NSPrincipalClass</key> like that :

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
   <key>NSPrincipalClass</key>
   <key>CFBundleDevelopmentRegion</key>
   <string>English</string>
   <key>CFBundleExecutable</key>
   <string>CodeBlocks</string>
   <key>CFBundleInfoDictionaryVersion</key>
   <string>6.0</string>
   <key>CFBundleName</key>
   <string>CodeBlocks</string>
   <key>CFBundleIconFile</key>
   <string>app.icns</string>
   <key>CFBundlePackageType</key>
   <string>APPL</string>
   <key>CFBundleVersion</key>
   <string>CodeBlocks version 13.12</string>
   <key>CFBundleShortVersionString</key>
   <string>CodeBlocks version 13.12</string>
   <key>LSRequiresCarbon</key>
   <true/>
   <key>CFBundleGetInfoString</key>
   <string>CodeBlocks version 13.12, (c) 2004-2013 Code::Blocks</string>
   <key>CFBundleLongVersionString</key>
   <string>CodeBlocks version 13.12 SVN revision 8629, (c) 2004-2013 Code::Blocks</string>
   <key>NSHumanReadableCopyright</key>
   <string>Copyright 2004-2013, The Code::Blocks Team</string>
   <key>CFBundleIdentifier</key>
   <string>org.codeblocks.app</string>
   <key>CFBundleDocumentTypes</key>
   <array>
      <dict>
         <key>CFBundleTypeExtensions</key>
         <array>
            <string>cbp</string>
         </array>
         <key>CFBundleTypeIconFile</key>
         <string>cbp.icns</string>
         <key>CFBundleTypeName</key>
         <string>CodeBlocks Project File</string>
         <key>CFBundleTypeRole</key>
         <string>Editor</string>
      </dict>
      <dict>
         <key>CFBundleTypeExtensions</key>
         <array>
            <string>workspace</string>
         </array>
         <key>CFBundleTypeIconFile</key>
         <string>csd.icns</string>
         <key>CFBundleTypeName</key>
         <string>CodeBlocks Workspace File</string>
         <key>CFBundleTypeRole</key>
         <string>Editor</string>
         <key>LSIsAppleDefaultForType</key>
         <true/>
         <key>LSTypeIsPackage</key>
         <false/>
      </dict>
      <dict>
         <key>CFBundleTypeExtensions</key>
         <array>
            <string>h</string>
            <string>pch</string>
         </array>
         <key>CFBundleTypeIconFile</key>
         <string>h.icns</string>
         <key>CFBundleTypeName</key>
         <string>C Header Source File</string>
         <key>CFBundleTypeRole</key>
         <string>Editor</string>
      </dict>
      <dict>
         <key>CFBundleTypeExtensions</key>
         <array>
            <string>hp</string>
            <string>hpp</string>
            <string>hxx</string>
            <string>h++</string>
            <string>pch++</string>
         </array>
         <key>CFBundleTypeIconFile</key>
         <string>h.icns</string>
         <key>CFBundleTypeName</key>
         <string>C++ Header Source File</string>
         <key>CFBundleTypeRole</key>
         <string>Editor</string>
      </dict>
      <dict>
         <key>CFBundleTypeExtensions</key>
         <array>
            <string>c</string>
         </array>
         <key>CFBundleTypeIconFile</key>
         <string>c.icns</string>
         <key>CFBundleTypeName</key>
         <string>C Source File</string>
         <key>CFBundleTypeRole</key>
         <string>Editor</string>
      </dict>
      <dict>
         <key>CFBundleTypeExtensions</key>
         <array>
            <string>cc</string>
            <string>cp</string>
            <string>cpp</string>
            <string>cxx</string>
            <string>c++</string>
         </array>
         <key>CFBundleTypeIconFile</key>
         <string>cpp.icns</string>
         <key>CFBundleTypeName</key>
         <string>C++ Source File</string>
         <key>CFBundleTypeRole</key>
         <string>Editor</string>
      </dict>
      <dict>
         <key>CFBundleTypeExtensions</key>
         <array>
            <string>d</string>
         </array>
         <key>CFBundleTypeIconFile</key>
         <string>d.icns</string>
         <key>CFBundleTypeName</key>
         <string>D Source File</string>
         <key>CFBundleTypeRole</key>
         <string>Editor</string>
      </dict>
      <dict>
         <key>CFBundleTypeExtensions</key>
         <array>
            <string>s</string>
            <string>asm</string>
         </array>
         <key>CFBundleTypeName</key>
         <string>Assembly Source File</string>
         <key>CFBundleTypeRole</key>
         <string>Editor</string>
      </dict>
      <dict>
         <key>CFBundleTypeExtensions</key>
         <array>
            <string>*</string>
         </array>
         <key>CFBundleTypeName</key>
         <string>Plain Text File</string>
         <key>CFBundleTypeOSTypes</key>
         <array>
            <string>****</string>
         </array>
         <key>CFBundleTypeRole</key>
         <string>Editor</string>
      </dict>
   </array>
</dict>
</plist>

But when i zip the application and dezip it, i have the message : "This file is damaged or incomplete".

It's not really a problem to have icons that are not sharp but the text is really important since i really struggle to read all the code if i have hundreds of lines in it.

I truly appreciate your help. Thanks a lot.
« Last Edit: February 14, 2014, 12:55:41 am by user4385re »

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: CodeBlocks on retina display
« Reply #12 on: February 15, 2014, 04:35:17 pm »
@Morten: Do you know if anyone ever made an SVG icon set? That would make it a lot easier to get a consistent icon set that works across multiple resolutions.
There is a big number of SVGs outside the normal source tree (so it isn't checked out by everyone who doesn't need them), basically all icons that were specifically made for Code::Blocks and not borrowed from tango or what it's called.

That is... hopefully they're in the current repo, because I deleted the originals two or three weeks ago when replacing harddisks...
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: CodeBlocks on retina display
« Reply #13 on: February 15, 2014, 06:42:56 pm »
I found the file info.plist and i added <key>NSPrincipalClass</key> like that :
...
But when i zip the application and dezip it, i have the message : "This file is damaged or incomplete".

It's not really a problem to have icons that are not sharp but the text is really important since i really struggle to read all the code if i have hundreds of lines in it.

I truly appreciate your help. Thanks a lot.

Probably some sort of md5 sum check in the name of security.
 
Perhaps Morten would be so kind as to make the adjustment to the info.plist file and create a new mac bundle, or otherwise provide instruction on how to build it so you can do it yourself.

Offline user4385re

  • Single posting newcomer
  • *
  • Posts: 7
Re: CodeBlocks on retina display
« Reply #14 on: February 16, 2014, 12:20:09 pm »
It would be awesome !