FEM icons

A subforum for research and development of the user interface of FreeCAD

Moderator: agryson

User avatar
bernd
Posts: 3877
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

FEM icons

Postby bernd » Wed Mar 08, 2017 7:51 am

In FEM we lately renamed lots of tools to fit in a consistent name system for FEM. The icons have not been renamed so far but I would like to do this too. Is there a FreeCAD standard system to name icons? small letters, big letters, underline, minus, etc ...

Bernd

https://github.com/berndhahnebach/FreeC ... es/Fem.qrc
https://github.com/berndhahnebach/FreeC ... rces/icons
User avatar
PrzemoF
Posts: 1708
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: FEM icons

Postby PrzemoF » Wed Mar 08, 2017 8:25 am

Hi bernd,

"1.6 Icon names should use fem- prefix, only small letters and dashes for separation. like fem-add-part or fem-inp-editor. The only exception is preferences-fem.svg which is used for FEM preferences."

https://forum.freecadweb.org/viewtopic.php?f=18&t=12833

I guess nobody is actively enforcing that standard, so we have icons like: fem-DataAlongLine.png or fem-constraint-InitialTemperature.svg
User avatar
bernd
Posts: 3877
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: FEM icons

Postby bernd » Wed Mar 08, 2017 8:33 am

PrzemoF wrote:I guess nobody is actively enforcing that standard, so we have icons like: fem-DataAlongLine.png or fem-constraint-InitialTemperature.svg
Me! I would like to get it back to a standard! That is why I made the post ! :mrgreen:

Might be interesting what the other WBs do?
User avatar
PrzemoF
Posts: 1708
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: FEM icons

Postby PrzemoF » Wed Mar 08, 2017 8:45 am

After a quick check (1) there seem to be 3 styles:

1. fem-standard.svg
2. Camel_With_Underscore.svg
3. Camel-With-Dash.svg


(1) git ls-files | grep Mod | grep svg | grep -v Templates
User avatar
bernd
Posts: 3877
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: FEM icons

Postby bernd » Thu Mar 09, 2017 9:38 am

PrzemoF wrote:1. fem-standard.svg
2. Camel_With_Underscore.svg
3. Camel-With-Dash.svg
Does some other WB uses fem-standard-icon-nameing.svg too or is FEM alone with this ?
triplus
Posts: 4866
Joined: Mon Dec 12, 2011 4:45 pm

Re: FEM icons

Postby triplus » Thu Mar 09, 2017 2:13 pm

The same name as used for command names should do. Avoids clashes and easy to discover.
User avatar
PrzemoF
Posts: 1708
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: FEM icons

Postby PrzemoF » Thu Mar 09, 2017 6:13 pm

Correction: there are also NormalCamels and InternallyInconsistent_Camels :lol:

I'd stick to fem-is-the-best version. It's the easiest (for me) to read.
User avatar
bernd
Posts: 3877
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: FEM icons

Postby bernd » Thu Mar 09, 2017 6:19 pm

triplus wrote:The same name as used for command names should do. Avoids clashes and easy to discover.
mhh I like this one !

@przemo:
Do you remember the reason we decided to use the fem-standard-name-for-icon-style.svg I must admit I really like the idea of triplus just to use the command class names without command (in python they are the same than the module file name) See https://github.com/FreeCAD/FreeCAD/blob ... xt#L70-L90 and https://github.com/FreeCAD/FreeCAD/blob ... ommand.cpp Or even better directly the command names https://github.com/FreeCAD/FreeCAD/blob ... pp#L57L183

Lately we have been changing a lot in naming in FEM. It is a good time to do such change and it would be the last one in all this renaming in FEM to reach a consistent name system

bernd
User avatar
PrzemoF
Posts: 1708
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: FEM icons

Postby PrzemoF » Thu Mar 09, 2017 6:32 pm

I was not doing any development in FEM for quite while, you have to make the call. Post it here and I'll update the coding style guide.

The reasons behind-the-icon-naming were simple:
- no capitals - capitals are for important things (CONST names)
- no underline - -it's for internal functions (first character) and is invisible in links
- fem in front to avoid clashes

None of those 3 are important, so go for whatever is good for you :)
User avatar
bernd
Posts: 3877
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: FEM icons

Postby bernd » Thu Mar 09, 2017 6:43 pm

PrzemoF wrote:git ls-files | grep Mod | grep svg | grep -v Templates
very cool command :)