Dev: Academy guide on group commands (toolbar drop-downs and submenus)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 56/100
- Tipo de issue
- Documentación
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- hugo
- Área
- documentation
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- HTML
- Estrellas
- 3
- Forks
- 10
- Merge medio
- 1 d 18 h
- PR fusionados (30 d)
- 27
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de FreeCAD/Website
-
Feature
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
Help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
FreeCAD/Website#89 · 21 comentarios ·
Los mantenedores suelen responder en 1 día
-
CMS Help wanted News Tools
Dificultad 5/5 Más de una semana Aptitud para principiantes 20/100
FreeCAD/Website#112 · 9 comentarios · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Bug
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
FreeCAD/Website#111 · 26 comentarios · 2 reacciones ·
Los mantenedores suelen responder en 1 día
-
Bug: Staging deployement killedAbierto:octocat: Bug github_actions Hugo
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
FreeCAD/Website#105 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de FreeCAD/Website
Issues similares
-
ReferencesAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 70/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
jaegertracing/documentation#1213 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
sky-map-team/stardroid#1422 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
eclipse-score/kyron#249 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
eclipse-score/logging#531 ·
Los mantenedores suelen responder en 2 días