Author Topic: Problem with icons on HiDPI displays  (Read 2129 times)

Offline darmar

  • Multiple posting newcomer
  • *
  • Posts: 50
Problem with icons on HiDPI displays
« on: June 10, 2018, 01:03:58 pm »
Icons in C::B are too small on HiDPI displays. I am experiencing it myself and others do too (e.g. http://forums.codeblocks.org/index.php/topic,21724.msg147764.html#msg147764 )
 
Are there any changes on this matter? Do somebody has already started to implement required changes?

If not, I could put some of my efforts for solving this problem.

Maybe somebody could advise what steps should be taken?
I was thinking about (a) the making icons with different sizes and (2) implementing in C::B the possibility to choose these icon sets.
« Last Edit: June 10, 2018, 01:59:44 pm by darmar »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11492
    • Travis build status
Re: Problem with icons on HiDPI displays
« Reply #1 on: June 10, 2018, 07:45:12 pm »
As a start we need bigger icons.
I'm agitating a person to do the work, but the progress is really slow there.
I've not looked what we need to do after we have the bigger icons.
I'm running at 160dpi and 22x22 icons aren't too small. :)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline darmar

  • Multiple posting newcomer
  • *
  • Posts: 50
Re: Problem with icons on HiDPI displays
« Reply #2 on: June 11, 2018, 08:35:21 am »
Quote
As a start we need bigger icons.

Which icons are needed? How big they should be? Maybe I will be more successful in agitating somebody  ;).

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11492
    • Travis build status
Re: Problem with icons on HiDPI displays
« Reply #3 on: June 11, 2018, 08:51:45 am »
All of them. :) I think to be safe we need sizes as big as 64x64 or even 128x128 for toolbar icons.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline headkase

  • Almost regular
  • **
  • Posts: 159
Re: Problem with icons on HiDPI displays
« Reply #4 on: June 11, 2018, 02:45:08 pm »
All of them. :) I think to be safe we need sizes as big as 64x64 or even 128x128 for toolbar icons.

With the caveat that I'm a noob, if it has to be done then how about doing it once: create scalable vector graphic files, SVGs, for the icons.  Then those definitions can, even on the fly, be used to create whatever size to your heart's content?

https://en.wikipedia.org/wiki/Scalable_Vector_Graphics
« Last Edit: June 11, 2018, 02:46:58 pm by headkase »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11492
    • Travis build status
Re: Problem with icons on HiDPI displays
« Reply #5 on: June 11, 2018, 04:54:01 pm »
SVGs aren't 100% suitable for the task, because the anti-aliasing algorithms have troubles producing sharp images for the smallest sizes.
So, even if SVG is used as a base for the icons, a manual pass is still required in order to make the icons look really good.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2253
Re: Problem with icons on HiDPI displays
« Reply #6 on: June 11, 2018, 11:57:16 pm »
SVGs aren't 100% suitable for the task, because the anti-aliasing algorithms have troubles producing sharp images for the smallest sizes.
So, even if SVG is used as a base for the icons, a manual pass is still required in order to make the icons look really good.
i can only confirm this. Converting svg images to low resolution does not work at all... Maybe starting from 128x128 svgs are acceptable, but i have not tested this. Nerveless I would recommend to rework all icons to svg , so for future use they are in a nice scalable format...

Offline darmar

  • Multiple posting newcomer
  • *
  • Posts: 50
Re: Problem with icons on HiDPI displays
« Reply #7 on: June 20, 2018, 08:50:39 am »
Work progress

There was created a project called "cb-icons" on github ( https://github.com/specialmart/cb-icons ).
Currently were created only icons used by Debugger plugin.
Icons are created in SVG format using Inkscape and are exported to PNGs. Normaly are created two SVG files for each icon. "*32.svg" are used for export to 32, 36, 128 size PNG files. "*24.svg" or "*48.svg" are used to export to 48 size PNG files. Lines in SVG files are drawn on pixel locations to make PNG look sharp.

Please write your suggestions about the icons.

Questions:
1) Icons are created in 32, 48, 64, 128 size. Icons of 16 size and 22 (for toolbars only) size are already shipped with C::B. Is it OK?
2) It seems to me, that some icons in the image directory "trunk/src/src/resources/images/" are unused. E.g. "compile.png", "compilerun.png" etc. I think, that the Compiler plugin has its own icon set. Am I wrong? Perhaps, can somebody remove unused icons from the C::B repository? Or just write me a list with the unused icons?



Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11492
    • Travis build status
Re: Problem with icons on HiDPI displays
« Reply #8 on: June 20, 2018, 09:23:50 am »
1. What about the 24 and 28? I'm currently using size 22 on a 160dpi monitor and they look almost right. The pngs for size 32 looked blurry in firefox, but the svg looked sharper.
2. You'll have to search the source for every icon. :(
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline darmar

  • Multiple posting newcomer
  • *
  • Posts: 50
Re: Problem with icons on HiDPI displays
« Reply #9 on: June 20, 2018, 09:32:46 am »
Do we need 24 icons, when 22 already exist?

Note: If you look icons directly from a browser, make sure that the zoom level is at 100%. Otherwise, any image is blurred.
« Last Edit: June 20, 2018, 09:35:07 am by darmar »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11492
    • Travis build status
Re: Problem with icons on HiDPI displays
« Reply #10 on: June 20, 2018, 10:13:16 am »
Not sure about 24.
It would probably be good if we support scales like 1.25, 1.5, 1.75, 2.0. If we select 16 as base. We get 20, 24, 28, 32.
Also we need some code to select the size automatically, but I guess this is doable in later wx's and it is a separate issue.

Yes, I'm looking the image at 100%, but the blurriness might be caused because the browser does some scaling due to my higher dpi. I've opened it in an image browser and it looks fine.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2253
Re: Problem with icons on HiDPI displays
« Reply #11 on: June 20, 2018, 11:56:15 pm »
They look really good! Good job!

Offline darmar

  • Multiple posting newcomer
  • *
  • Posts: 50
Re: Problem with icons on HiDPI displays
« Reply #12 on: January 27, 2019, 06:34:34 pm »
The work on the icons was going perhaps too slow, but now most of the icons are finished. See on https://github.com/specialmart/cb-icons. Every icon has SVG files in 20, 24, 28 and 32 size which are used to export automatically to 20, 24, 28, 32, 40, 48,... pixel size png files. The person who worked on them (not me) is not professional designer, therefore some adjustment may be required in the future.

Before creation of more icons, I think, it would be nice to know the way how to integrate these icons into C::B code.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2253
Re: Problem with icons on HiDPI displays
« Reply #13 on: January 27, 2019, 07:18:05 pm »
If we work on them, can we repack them? Put them in zip archives for every plugin? So all icons/images are not all in one folder, but grouped to the plugin where they should be? This would make install, uninstall plugins make much more straight forward.

For loading them from the zip file we could add some loader function to the plugin class for easy access...

I use this approach in my plugins and i think it is a lot more cleaner then putting them in the global image folder...

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11492
    • Travis build status
Re: Problem with icons on HiDPI displays
« Reply #14 on: January 27, 2019, 08:43:36 pm »
Before creation of more icons, I think, it would be nice to know the way how to integrate these icons into C::B code.

Do you want to do the work? Or are you asking if any of us could/would do it? I can integrate them during next week...

If we work on them, can we repack them? Put them in zip archives for every plugin? So all icons/images are not all in one folder, but grouped to the plugin where they should be? This would make install, uninstall plugins make much more straight forward.

What do you mean?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2253
Re: Problem with icons on HiDPI displays
« Reply #15 on: January 28, 2019, 12:04:11 am »
Plugins like wxSmith or BrowseTracker or debugger have a lot images. All this images are stored in the share\CodeBlocks\images folder or in the  share\CodeBlocks\resources.zip\images archive
I do not know which one are used, but i do not think they should be mixed like that...

The icons and images for the wxSmith plugin should be in share\CodeBlocks\wxsmith.zip
for the debugger plugin in share\CodeBlocks\debugger.zip
ecc...

What is specially do not like about this is when you uninstall one of this plugins, the images still remain in the folder and are not deleted...

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11492
    • Travis build status
Re: Problem with icons on HiDPI displays
« Reply #16 on: January 28, 2019, 01:26:19 am »
for the debugger plugin in share\CodeBlocks\debugger.zip
The debugger plugin almost has no images. I've not checked lately, but most of its images are part of the sdk or src folders.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline darmar

  • Multiple posting newcomer
  • *
  • Posts: 50
Re: Problem with icons on HiDPI displays
« Reply #17 on: January 28, 2019, 07:24:06 pm »
Today in  "cb-icons" on github direct in "images" folder are only icons used by C::B core, while icons from plugins are in separate directories. I can change this order if it is required.

Quote
Do you want to do the work? Or are you asking if any of us could/would do it? I can integrate them during next week...

If you can integrate these icons into C::B tree, it is perfect. I think, that developers of C::B are those who decide about the structure of the code.

About wxSmith plugin. It has a lot of icons and no one was created yet. Do somebody can tell me how these icons was created?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11492
    • Travis build status
Re: Problem with icons on HiDPI displays
« Reply #18 on: January 28, 2019, 07:42:06 pm »
Today in  "cb-icons" on github direct in "images" folder are only icons used by C::B core, while icons from plugins are in separate directories. I can change this order if it is required.
It is fine the way it is as far as I can tell, I'll ask questions if there are problems.

If you can integrate these icons into C::B tree, it is perfect. I think, that developers of C::B are those who decide about the structure of the code.

Fine, I'll do it.

About wxSmith plugin. It has a lot of icons and no one was created yet. Do somebody can tell me how these icons was created?

No idea.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11492
    • Travis build status
Re: Problem with icons on HiDPI displays
« Reply #19 on: February 10, 2019, 11:42:48 am »
darmar: Do you know if the person doing the work on the icons wants to be credited in a commit message or the about dialog?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline darmar

  • Multiple posting newcomer
  • *
  • Posts: 50
Re: Problem with icons on HiDPI displays
« Reply #20 on: February 10, 2019, 12:39:20 pm »
Specialmart told me, thank in a commit message is OK.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11492
    • Travis build status
Re: Problem with icons on HiDPI displays
« Reply #21 on: February 10, 2019, 01:49:01 pm »
Should I use 'Specialmart' or some real name?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline darmar

  • Multiple posting newcomer
  • *
  • Posts: 50
Re: Problem with icons on HiDPI displays
« Reply #22 on: February 10, 2019, 03:13:22 pm »
Specialmart is OK.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9479
Re: Problem with icons on HiDPI displays
« Reply #23 on: February 10, 2019, 03:23:28 pm »
Great work, but keep in mind that it might be even simpler:

Most icons are available as SVG in the repo here:

https://svn.code.sf.net/p/codeblocks/code/resources

You only need to save/export these vector graphics in other sizes and you are done for the core.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline darmar

  • Multiple posting newcomer
  • *
  • Posts: 50
Re: Problem with icons on HiDPI displays
« Reply #24 on: February 10, 2019, 06:13:04 pm »
Yes, these SVG files were used where was possible. Also this folder contains several SVG icons used in Environment and Editor settings dialogs. However, the icons for these dialogs were not created yet.

By the way, only icons really used in C::B is created. Some icons are in the source tree, however are not used. I remember this is the case with ThreadSearch plugin. It can be, that I just overlooked something. Let me know about it.

SVG files for icons were created as close as possible to the existing *.png icons. However there are exceptions:
1) misc_16x16.png icon. It is blue 3D gear used on "Logs & others" window in "Build log" and "Debugger" tabs. It is quite (too) complicated icon to make in SVG. This icon was changed with a simpler 2D gear icon found in the C::B repo. See screenshot.
2) trash.png icon used in "Start here" tab for reopen recently used projects (can be found in /src/resources/start_here/). I do not want to hurt anyone, however I dislike this icon here. It is like saying for the user: "Your work is just trash. If you like, take it from there." I changed it to an icon with rotating arrows. See screenshot.