Formatting buttons

Discussions about the wiki documentation of FreeCAD and its translation.
hmk
Posts: 44
Joined: Tue Sep 29, 2020 1:19 pm
Location: Berlin, Germany

Formatting buttons

Postby hmk » Thu Jan 14, 2021 4:19 pm

What is the correct way of formatting a button? Currently, this seems a bit messy...

I have seen:
- KEY vs. Button
- 16px vs. 24px
- Including text/link or not
- '''text''' or just plain (in and outside the template)
- File: vs. Image:

Some examples, all differ from each other:

Code: Select all

Press the {{KEY|[[Image:PartDesign_Pocket.svg|16px]] '''Pocket'''}} button.
Press the {{Button|[[Image:Part Box.svg|16px]]}} button in the toolbar.
Press the {{KEY|[[File:Part Offset2D.svg|24px]]}} '''Offset2D''' button.
Press the [[Image:Part Torus.svg|24px]] button. 
Press the {{Button|[[File:Sketcher_CreateFillet.svg|16px]] [[Sketcher_CreateFillet|CreateFillet]]}} button.
The Sketcher seems most consistent too me, can I take this as the (approximate) gold standard?

n.b. I already did change a few buttons before I noticed that my formatting may be off -- sorry for that, I will fix ASAP if needed.
User avatar
Roy_043
Posts: 2391
Joined: Thu Dec 27, 2018 12:28 pm

Re: Formatting buttons

Postby Roy_043 » Thu Jan 14, 2021 5:47 pm

There is an model page: GuiCommand_model which says:

Code: Select all

{{Button|[[Image:Std_Open.svg|16px]] [[GuiCommand model|Command name]]}}
I try to follow that. But not all editors do.

hmk wrote:
Thu Jan 14, 2021 4:19 pm
File: vs. Image:
I don't think that is very important. Both work for images.

The KEY template is often misused, but so is the Button template, as a way to make the name of a command/tool stand out. Just using bold text is not enough for many editors.
hmk
Posts: 44
Joined: Tue Sep 29, 2020 1:19 pm
Location: Berlin, Germany

Re: Formatting buttons

Postby hmk » Fri Jan 15, 2021 11:14 am

Roy_043 wrote:
Thu Jan 14, 2021 5:47 pm
There is an model page: GuiCommand_model which says:
Terrific, I was hoping for something like this -- very well done IMHO! This certainly increase my confidence when making changes in the future. :)