Skip to content

Commit 835a49e

Browse files
authored
[222_83] 动画工具栏仅在开发工具开启时显示 (#3291)
1 parent 3c0adc0 commit 835a49e

3 files changed

Lines changed: 75 additions & 4 deletions

File tree

TeXmacs/progs/generic/insert-menu.scm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,8 @@
144144
(if (detailed-menus?)
145145
(if (style-has? "std-fold-dtd")
146146
(-> "Fold" (link insert-fold-menu)))
147-
(-> "Animation" (link insert-animation-menu)))
147+
(if (with-developer-tool?)
148+
(-> "Animation" (link insert-animation-menu))))
148149
(if (and (style-has? "session-dtd") (detailed-menus?) (not (in-math?)))
149150
(-> "Session" (link insert-session-menu))))
150151

TeXmacs/progs/texmacs/menus/view-menu.scm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,6 @@
149149
(if (with-developer-tool?)
150150
("Left side tools" (toggle-visible-side-tools 1))
151151
("Right side tools" (toggle-visible-side-tools 0))
152-
("GUI through markup" (toggle-markup-gui)))
153-
---
154-
("Animation toolbar" (toggle-bottom-bar "animate")))
152+
("GUI through markup" (toggle-markup-gui))
153+
---
154+
("Animation toolbar" (toggle-bottom-bar "animate"))))

devel/222_83.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# [222_83] 动画工具栏仅在开发工具模式下启用
2+
3+
## 相关文档
4+
- [x_y.md](x_y.md) - 开发文档模板
5+
6+
## 任务相关的代码文件
7+
- `TeXmacs/progs/texmacs/menus/view-menu.scm`
8+
- `TeXmacs/progs/generic/insert-menu.scm`
9+
- `TeXmacs/progs/texmacs/menus/tools-menu.scm`
10+
- `TeXmacs/progs/kernel/texmacs/tm-modes.scm`
11+
12+
## 如何测试
13+
1. 启动 Mogan
14+
2. 点击 `查看` 菜单,确认没有 `动画工具栏` 选项
15+
3. 点击 `插入` 菜单,确认没有 `动画` 子菜单
16+
4. 点击 `工具 -> 开发工具`,勾选启用开发工具
17+
5. 再次点击 `查看` 菜单,确认出现 `动画工具栏` 选项
18+
6. 再次点击 `插入` 菜单,确认出现 `动画` 子菜单
19+
7. 点击 `动画工具栏`,确认底部动画工具栏正常显示和工作
20+
21+
## 如何提交
22+
```bash
23+
# 提交前执行的最少测试步骤
24+
xmake build mogan
25+
./build/mogan
26+
```
27+
28+
## 2026/05/08 将动画相关菜单放入开发工具条件分支
29+
30+
### What
31+
`查看` 菜单中的 `动画工具栏` 选项和 `插入` 菜单中的 `动画` 子菜单移到 `(if (with-developer-tool?) ...)` 条件内,使其仅在开发工具开启时可见。
32+
33+
### Why
34+
动画相关功能目前还不成熟,不应向普通用户暴露该入口。开发工具模式面向开发者,允许访问实验性功能。
35+
36+
### How
37+
`view-menu.scm` 中,将原来的:
38+
```scheme
39+
(if (with-developer-tool?)
40+
("Left side tools" (toggle-visible-side-tools 1))
41+
("Right side tools" (toggle-visible-side-tools 0))
42+
("GUI through markup" (toggle-markup-gui)))
43+
---
44+
("Animation toolbar" (toggle-bottom-bar "animate"))
45+
```
46+
改为:
47+
```scheme
48+
(if (with-developer-tool?)
49+
("Left side tools" (toggle-visible-side-tools 1))
50+
("Right side tools" (toggle-visible-side-tools 0))
51+
("GUI through markup" (toggle-markup-gui))
52+
---
53+
("Animation toolbar" (toggle-bottom-bar "animate")))
54+
```
55+
56+
`insert-menu.scm` 中,将原来的:
57+
```scheme
58+
(if (detailed-menus?)
59+
(if (style-has? "std-fold-dtd")
60+
(-> "Fold" (link insert-fold-menu)))
61+
(-> "Animation" (link insert-animation-menu)))
62+
```
63+
改为:
64+
```scheme
65+
(if (detailed-menus?)
66+
(if (style-has? "std-fold-dtd")
67+
(-> "Fold" (link insert-fold-menu)))
68+
(if (with-developer-tool?)
69+
(-> "Animation" (link insert-animation-menu))))
70+
```

0 commit comments

Comments
 (0)