Skip to content

Conversation

@notfoundzzz
Copy link
Contributor

如何测试

  1. 在文档中插入块级代码(例如 Python/Cpp/Scheme/Shell)。
  2. 将鼠标悬浮到代码区域顶部,确认出现“复制”按钮。
  3. 点击“复制”,粘贴到外部编辑器应为纯文本代码。
  4. 在行内代码、代码清单环境中重复上述操作。
  • 测试文档: TeXmacs/tests/tmu/209_13.tmu

2026/01/28 代码悬浮菜单与多语言支持

What

  • 新增代码悬浮菜单(Qt 端)与显示/隐藏/滚动同步逻辑。
  • 鼠标悬浮检测支持块级与行内代码。
  • 复制操作通过 Scheme 执行,导出为 verbatim。
  • 按钮文本与提示使用翻译表(随语言变化)。
  • C++ 侧补齐 Scheme 端支持的代码环境标签。
  • 主题中增加 code popup 样式(浅色/深色)。

How

  • C++:新增 QTMCodePopup,并在 qt_simple_widget/QTMWidget 接入显示与滚动同步。
  • C++:在 edit_mouse.cpp 中沿祖先路径查找代码节点,使用 is_verbatim() 判断。
  • Scheme:新增 code-popup-copy,用 clipboard-copy-export "verbatim" 实现纯文本复制。
  • 主题:添加 #code_popup#code-popup-button 样式。
  • is_verbatim() 补齐 python-code 等标签,与 Scheme 侧定义对齐。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant