← Back to team overview

kicad-developers team mailing list archive

Re: KiCad new look - new icons and new buttons

 

On 08/23/2011 10:22 AM, Dick Hollenbeck wrote:
> On 08/23/2011 09:42 AM, fabrizio wrote:
>> Hello,
>> thank you all for these replies, I have made some mockups for some
>> main toolbars:
>> http://www.vincentresearch.com/tmp/
>>
>> 26px for buttons and 48px for the KiCad icons seems ok to me. Anybody
>> is concern about the overall size of the new toolbars?
>>
>> I am currently using this to go from .svg to .png:
>> inkscape -f file.svg -e file.png -d 120 -w 26 -h 26
> inkscape might be fine as a cross platform tool.  Not everyone will need it.
>
>
>> before I was using imagemagick but I had some minor problems. I am not
>> really sure how to do this with a portable tool to be used during
>> compilation but it seems that many of you guys know.
>>
>> GEDA uses .xpm files for its icons. Are we sure we gain much going to
>> .png? From all these discussions it sounds like a lot of work.
> We are still measuring the work, it would be premature to reach a conclusion.
>
> Jean-Pierre, how are you generating the XPM files now?  Can this be automated
> into a script for all bitmaps?
>
> Obviously we can automate the PNG to wxBitmap process, as per my previous email.
>
> The remaining unknown is how tough it is to teach the Windows version of
> wxWidgets about PNG.

wxWidgets/src/common/imagpng.cpp

Seems we're golden if we want to go this way.

I would suggest that we do it, but would like to tweak my earlier strategy just
a little. 

1) create a *.cmake script to go the full distance from *.svg to *.cpp, where
the *.cpp file is holding the PNG image, as I said previously.

2) do not check in the *.png files into the source tree, we really do not need
them.  This way we have only 2 text files per bitmap in the source tree:

a) *.svg

and

b) *.cpp  representation of it's PNG form


The *.cmake script can be run from a CMakeLists.txt file which is only normally
run when you tweak the collective *.svg file content.  I foresee perhaps two
*.cmake scripts, one building the *.cpp file from a *.svg, and another to make
the bitmaps.h file.


I fear the *.png -> to *.cpp step could be a little slow if done in CMake, so it
should not be based on newness just like a normal conditional operation.

There could be a gotcha in my plan regarding static constructors running before
wxWidgets is set up.  But maybe that will not bite us.

It is about 1 full day to do this, inclusive of all the edits to the source code
where we are now constructing the wxBitmaps, which would need to be changed to
simply use global, pre-existing wxBitmaps.

A quick test of this can be done by trying it manually, that is linking a hand
written bitmap file along with the MakeBitmap function.

If no one else wants to do it, I would volunteer to do it, perhaps as a patch
initially, if folks want to go this way.


Dick




Follow ups

References