Combo view Tree icons and view provider questions

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
jmaustpc
Posts: 9633
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Combo view Tree icons and view provider questions

Postby jmaustpc » Mon Mar 11, 2013 4:16 pm

neondata wrote:Hello, let me jump in here: I didn't follow the whole thread, but agree it would be good to have "speaking" icons. It should be quite simple to use the icons that generate features to symbolize them in the tree. I wanted to patch them together in one picture and so to have them grouped and documented why and what is decided. But I couldn't find the icons as separate files and do know, how to extract them from the modules. What's your opinion?
The icons are in the source code, mostly under the Mod/ directory for which they apply. E.g. Part workbench icons are mostly under /freecad/src/Mod/Part/Gui/Resources/icons. Some of the icons that are in all workbenches are in /freecad/src/Gui/Resources/icons.

If you want to create icons, first read the wiki, start here (note that some of the icons will not display properly due to the limitations of the Sourceforge Wiki software, they are svg files and the files themselves are file, it is just that the wiki reads them and attempts to produce bit map images to display in your web browser...and it does not support all the svg standard)
https://sourceforge.net/apps/mediawiki/ ... le=Artwork

https://sourceforge.net/apps/mediawiki/ ... GuiCommand

If you create a new icon it must look reasonable at 16px...which is very difficult. It should also be an svg file.

I have now created almost all the "Tree" icons for the Part Primitives. Getting them to display is more complicated for some than others. You have to add the icon to the viewprovider however some items do not have their own viewprovider yet, I have created some of the easier viewproviders and inserted the icons in some existing ones that were just missing icons. I have asked Yorik to review and ...hopefully... commit the work I have completed. There will be a few more over the next few days.

Jim
jmaustpc
Posts: 9633
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Combo view Tree icons and view provider questions

Postby jmaustpc » Mon Mar 11, 2013 4:28 pm

I am not sure if you mean that you think we should use the same icons in the tree view as we do on the tool bars and other places. If so, we do sometimes where it is possible, but sometimes they need to be different, mostly due to colour.

Jim
jmaustpc
Posts: 9633
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Combo view Tree icons and view provider questions

Postby jmaustpc » Wed Mar 13, 2013 10:10 am

Hi Yorik and all
I have pushed some more commits to my Github mymodsicons1 branch, today. From my point of view, all the code in this branch can go into master. The remaining items are more complicated, I don't know how long it will take for me to work out how to do the rest.

This is a screen shot showing all the items I have finished.

Image



Jim
jmaustpc
Posts: 9633
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Combo view Tree icons and view provider questions

Postby jmaustpc » Wed Mar 13, 2013 4:57 pm

Back again
I have been more productive than I had expected I would be. Now I have all the Part Tree icons displaying. :)

And the code is on GitHub here: -

https://github.com/jmaustpc/FreeCAD_sf_ ... modsicons1

Here's a screen shot, the real thing looks better.

Image

Jim
jmaustpc
Posts: 9633
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Combo view Tree icons and view provider questions

Postby jmaustpc » Thu Mar 14, 2013 4:16 am

Hi all
I have finished this work now. The code for this is in a new branch on my Github repository called "mymodsicons1_pullrequest".
See here: -

https://github.com/jmaustpc/FreeCAD_sf_ ... ullrequest

@ Yorik
Hi, I have rebased my work on SF/master today and then created the new branch above so that it has a nice clean history. I have 10 commits. I hope you will be happy to pull this into master. :)

I have updated the mantis ticket with the new link/branch details, here
https://sourceforge.net/apps/mantisbt/f ... hp?id=1052

regards
Jim
User avatar
yorik
Site Admin
Posts: 11717
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Combo view Tree icons and view provider questions

Postby yorik » Fri Mar 15, 2013 2:40 pm

Amazing work! I'll try to commit that today.
User avatar
yorik
Site Admin
Posts: 11717
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Combo view Tree icons and view provider questions

Postby yorik » Sat Mar 16, 2013 1:19 am

Congratulations Jim, you are now the newest FreeCAD developer! http://free-cad.git.sourceforge.net/git ... ;a=summary
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Combo view Tree icons and view provider questions

Postby NormandC » Sat Mar 16, 2013 3:03 am

The new icons all look nice, too bad I'll seldom see them (I rarely work with primitives).

One tiny critic: the cylinder's perspective is off IMO. The top ellipse is too slanted, it does not look like a circle in perspective but like an extruded ellipse.

I'm proposing the small fix below. (Right-click to download the svg.)

Image
jmaustpc
Posts: 9633
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Combo view Tree icons and view provider questions

Postby jmaustpc » Sat Mar 16, 2013 10:02 am

yorikvanhavre wrote:Congratulations Jim, you are now the newest FreeCAD developer! http://free-cad.git.sourceforge.net/git ... ;a=summary
Cool! Thanks Yorik. :)

@ Norm, if you want to change the Cylinder, its fine with me. :)

Jim
User avatar
yorik
Site Admin
Posts: 11717
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Combo view Tree icons and view provider questions

Postby yorik » Sat Mar 16, 2013 2:04 pm

I agree with Normand's icon... It looks more similar to the others you made.
I'm now thinking the different Draft objects could also gain icons like that...