Dev: Academy guide on group commands (toolbar drop-downs and submenus)
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 56/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- hugo
- Lĩnh vực
- documentation
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- HTML
- Star
- 3
- Fork
- 10
- Merge trung bình
- 1 ngày 18 giờ
- Pull request đã merge (30 ngày)
- 27
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của FreeCAD/Website
-
Feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
FreeCAD/Website#89 · 21 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
CMS Help wanted News Tools
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
FreeCAD/Website#112 · 9 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
FreeCAD/Website#111 · 26 bình luận · 2 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug: Staging deployement killedĐang mở:octocat: Bug github_actions Hugo
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
FreeCAD/Website#105 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của FreeCAD/Website
Issue tương tự
-
ReferencesĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
jaegertracing/documentation#1213 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
sky-map-team/stardroid#1422 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
eclipse-score/kyron#249 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
eclipse-score/logging#531 ·
Maintainer thường phản hồi trong vòng 2 ngày