From 7f931d2536ed8b8433b6d71ff971c4c646a56a78 Mon Sep 17 00:00:00 2001 From: Da Shen Date: Fri, 8 May 2026 11:45:58 +0800 Subject: [PATCH 1/2] =?UTF-8?q?[222=5F83]=20=E5=8A=A8=E7=94=BB=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E6=A0=8F=E4=BB=85=E5=9C=A8=E5=BC=80=E5=8F=91=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E5=BC=80=E5=90=AF=E6=97=B6=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TeXmacs/progs/texmacs/menus/view-menu.scm | 6 +-- devel/222_83.md | 51 +++++++++++++++++++++++ 2 files changed, 54 insertions(+), 3 deletions(-) create mode 100644 devel/222_83.md diff --git a/TeXmacs/progs/texmacs/menus/view-menu.scm b/TeXmacs/progs/texmacs/menus/view-menu.scm index 2fe31719d8..041964577a 100644 --- a/TeXmacs/progs/texmacs/menus/view-menu.scm +++ b/TeXmacs/progs/texmacs/menus/view-menu.scm @@ -149,6 +149,6 @@ (if (with-developer-tool?) ("Left side tools" (toggle-visible-side-tools 1)) ("Right side tools" (toggle-visible-side-tools 0)) - ("GUI through markup" (toggle-markup-gui))) - --- - ("Animation toolbar" (toggle-bottom-bar "animate"))) + ("GUI through markup" (toggle-markup-gui)) + --- + ("Animation toolbar" (toggle-bottom-bar "animate")))) diff --git a/devel/222_83.md b/devel/222_83.md new file mode 100644 index 0000000000..cfbe62b96d --- /dev/null +++ b/devel/222_83.md @@ -0,0 +1,51 @@ +# [222_83] 动画工具栏仅在开发工具模式下启用 + +## 相关文档 +- [x_y.md](x_y.md) - 开发文档模板 + +## 任务相关的代码文件 +- `TeXmacs/progs/texmacs/menus/view-menu.scm` +- `TeXmacs/progs/texmacs/menus/tools-menu.scm` +- `TeXmacs/progs/kernel/texmacs/tm-modes.scm` + +## 如何测试 +1. 启动 Mogan +2. 点击 `查看` 菜单,确认没有 `动画工具栏` 选项 +3. 点击 `工具 -> 开发工具`,勾选启用开发工具 +4. 再次点击 `查看` 菜单,确认出现 `动画工具栏` 选项 +5. 点击 `动画工具栏`,确认底部动画工具栏正常显示和工作 + +## 如何提交 +```bash +# 提交前执行的最少测试步骤 +xmake build mogan +./build/mogan +``` + +## 2026/05/08 将动画工具栏放入开发工具条件分支 + +### What +将 `查看` 菜单中的 `动画工具栏` 选项移到 `(if (with-developer-tool?) ...)` 条件块内,使其仅在开发工具开启时可见。 + +### Why +动画相关功能目前还不成熟,不应向普通用户暴露该入口。开发工具模式面向开发者,允许访问实验性功能。 + +### How +在 `view-menu.scm` 中,将原来的: +```scheme + (if (with-developer-tool?) + ("Left side tools" (toggle-visible-side-tools 1)) + ("Right side tools" (toggle-visible-side-tools 0)) + ("GUI through markup" (toggle-markup-gui))) + --- + ("Animation toolbar" (toggle-bottom-bar "animate")) +``` +改为: +```scheme + (if (with-developer-tool?) + ("Left side tools" (toggle-visible-side-tools 1)) + ("Right side tools" (toggle-visible-side-tools 0)) + ("GUI through markup" (toggle-markup-gui)) + --- + ("Animation toolbar" (toggle-bottom-bar "animate"))) +``` From 5ebcd41374cdc17d196b75e7f052687f73a0c312 Mon Sep 17 00:00:00 2001 From: Da Shen Date: Fri, 8 May 2026 11:50:53 +0800 Subject: [PATCH 2/2] =?UTF-8?q?[222=5F83]=20=E6=8F=92=E5=85=A5=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E4=B8=AD=E7=9A=84=E5=8A=A8=E7=94=BB=E5=AD=90=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E4=B9=9F=E4=BB=85=E5=9C=A8=E5=BC=80=E5=8F=91=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E5=BC=80=E5=90=AF=E6=97=B6=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TeXmacs/progs/generic/insert-menu.scm | 3 ++- devel/222_83.md | 29 ++++++++++++++++++++++----- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/TeXmacs/progs/generic/insert-menu.scm b/TeXmacs/progs/generic/insert-menu.scm index 54c48226d6..bbf5902022 100644 --- a/TeXmacs/progs/generic/insert-menu.scm +++ b/TeXmacs/progs/generic/insert-menu.scm @@ -144,7 +144,8 @@ (if (detailed-menus?) (if (style-has? "std-fold-dtd") (-> "Fold" (link insert-fold-menu))) - (-> "Animation" (link insert-animation-menu))) + (if (with-developer-tool?) + (-> "Animation" (link insert-animation-menu)))) (if (and (style-has? "session-dtd") (detailed-menus?) (not (in-math?))) (-> "Session" (link insert-session-menu)))) diff --git a/devel/222_83.md b/devel/222_83.md index cfbe62b96d..fe2c957adb 100644 --- a/devel/222_83.md +++ b/devel/222_83.md @@ -5,15 +5,18 @@ ## 任务相关的代码文件 - `TeXmacs/progs/texmacs/menus/view-menu.scm` +- `TeXmacs/progs/generic/insert-menu.scm` - `TeXmacs/progs/texmacs/menus/tools-menu.scm` - `TeXmacs/progs/kernel/texmacs/tm-modes.scm` ## 如何测试 1. 启动 Mogan 2. 点击 `查看` 菜单,确认没有 `动画工具栏` 选项 -3. 点击 `工具 -> 开发工具`,勾选启用开发工具 -4. 再次点击 `查看` 菜单,确认出现 `动画工具栏` 选项 -5. 点击 `动画工具栏`,确认底部动画工具栏正常显示和工作 +3. 点击 `插入` 菜单,确认没有 `动画` 子菜单 +4. 点击 `工具 -> 开发工具`,勾选启用开发工具 +5. 再次点击 `查看` 菜单,确认出现 `动画工具栏` 选项 +6. 再次点击 `插入` 菜单,确认出现 `动画` 子菜单 +7. 点击 `动画工具栏`,确认底部动画工具栏正常显示和工作 ## 如何提交 ```bash @@ -22,10 +25,10 @@ xmake build mogan ./build/mogan ``` -## 2026/05/08 将动画工具栏放入开发工具条件分支 +## 2026/05/08 将动画相关菜单放入开发工具条件分支 ### What -将 `查看` 菜单中的 `动画工具栏` 选项移到 `(if (with-developer-tool?) ...)` 条件块内,使其仅在开发工具开启时可见。 +将 `查看` 菜单中的 `动画工具栏` 选项和 `插入` 菜单中的 `动画` 子菜单移到 `(if (with-developer-tool?) ...)` 条件内,使其仅在开发工具开启时可见。 ### Why 动画相关功能目前还不成熟,不应向普通用户暴露该入口。开发工具模式面向开发者,允许访问实验性功能。 @@ -49,3 +52,19 @@ xmake build mogan --- ("Animation toolbar" (toggle-bottom-bar "animate"))) ``` + +在 `insert-menu.scm` 中,将原来的: +```scheme + (if (detailed-menus?) + (if (style-has? "std-fold-dtd") + (-> "Fold" (link insert-fold-menu))) + (-> "Animation" (link insert-animation-menu))) +``` +改为: +```scheme + (if (detailed-menus?) + (if (style-has? "std-fold-dtd") + (-> "Fold" (link insert-fold-menu))) + (if (with-developer-tool?) + (-> "Animation" (link insert-animation-menu)))) +```