FEM icons

A forum for research and development of the user interface of FreeCAD
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

FEM icons

Post by bernd »

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
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: FEM icons

Post by PrzemoF »

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
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: FEM icons

Post by bernd »

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
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: FEM icons

Post by PrzemoF »

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
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: FEM icons

Post by bernd »

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
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: FEM icons

Post by triplus »

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

Re: FEM icons

Post by PrzemoF »

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
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: FEM icons

Post by bernd »

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
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: FEM icons

Post by PrzemoF »

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
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: FEM icons

Post by bernd »

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