Dev: Academy guide on group commands (toolbar drop-downs and submenus)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 56/100
- Tipo di issue
- Documentazione
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- hugo
- Ambito
- documentation
Direzione di ricerca
Start by locating the Academy guide on creating toolbars in the website documentation and read how it is built. Add an example explaining grouped commands, their activation behavior and command type rules, plus guidance for finding valid menu names. Done when the guide covers these behaviors and answers how to identify menu entries.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Thank you for the great documentation on creating new toolbars.
Here is another useful example:
The command class (which is added via addCommand()) has an optional function named GetCommands(self) -> list[str]. You can return a list of command names to be grouped together. This new Group-Command can be used similar to a normal command item, but:
- In a toolbar it will display a drop-down list (like the Constraints or Circle combo menu).
- As a menu-item it will create a menu entry with all selected commands as submenu items.
There is also GetDefaultCommand(self) -> int which will trigger the command at chosen index (e.g. if user clicks on toolbar combo box without opening the drop-down).
The group can implement Activated(self, cmd: int = 0) -> None which provides the index of the performed action. If the group does NOT implement Activated(), the Activated() function of the child command is executed. If the group does implement Activated(), then the child is not called and the group is responsible for handling the action.
CmdType rules apply to the group first. E.g. if child command can be shown in edit mode, but group cannot, then you wont be able to call any child because the group will be deactivated.
...
As a related question: how to find valid menu names? E.g. I tried "Geometries" and it inserts a new menu item at the end of the "Sketch" menu. While this is where I want it to be, it is not where I would have expected the item to appear. I know the documentation says "names an entry, not a menu", but I dont know how to get either except by trial and error. Using an entry of a menu to append to that menu feels wrong, but I guess it is how it is.
- Lingua principale
- HTML
- Stelle
- 3
- Fork
- 10
- Merge medio
- 1g 18h
- PR unite (30g)
- 27
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di FreeCAD/Website
-
Feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
Help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
FreeCAD/Website#89 · 21 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
CMS Help wanted News Tools
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
FreeCAD/Website#112 · 9 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
FreeCAD/Website#111 · 26 commenti · 2 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
:octocat: Bug github_actions Hugo
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
FreeCAD/Website#105 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di FreeCAD/Website
Issue simili
-
ReferencesAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 70/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
jaegertracing/documentation#1213 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
sky-map-team/stardroid#1422 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
eclipse-score/kyron#249 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
eclipse-score/logging#531 ·
I maintainer di solito rispondono entro 2 giorni