Page 1 of 2
FEM icons
Posted: Wed Mar 08, 2017 7:51 am
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
Re: FEM icons
Posted: Wed Mar 08, 2017 8:25 am
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
Re: FEM icons
Posted: Wed Mar 08, 2017 8:33 am
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 !
Might be interesting what the other WBs do?
Re: FEM icons
Posted: Wed Mar 08, 2017 8:45 am
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
Re: FEM icons
Posted: Thu Mar 09, 2017 9:38 am
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 ?
Re: FEM icons
Posted: Thu Mar 09, 2017 2:13 pm
by triplus
The same name as used for command names should do. Avoids clashes and easy to discover.
Re: FEM icons
Posted: Thu Mar 09, 2017 6:13 pm
by PrzemoF
Correction: there are also NormalCamels and InternallyInconsistent_Camels
I'd stick to fem-is-the-best version. It's the easiest (for me) to read.
Re: FEM icons
Posted: Thu Mar 09, 2017 6:19 pm
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
Re: FEM icons
Posted: Thu Mar 09, 2017 6:32 pm
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
Re: FEM icons
Posted: Thu Mar 09, 2017 6:43 pm
by bernd
PrzemoF wrote:git ls-files | grep Mod | grep svg | grep -v Templates
very cool command