Repository navigation
[6241] 修复隐藏状态启动时无法通过底部页码按钮展开大纲侧边栏 - #4779
Merged
Merged
Conversation
- setOutline/loadDocumentOutline 不再在偏好 off 时清空大纲数据,仅隐藏 dock - toggle_outline_sidebar 展开时按需重载文档大纲 - SLOT_FILE 编辑器模式显式同步 outline dock 可见性 - 新增单元测试 test_setOutline_preference_off
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
当 "outline sidebar" 偏好为 "off"(上次退出时收起了大纲侧边栏)时,通过
xmake r stem ~/git/xiyouji/xiyouji.stem启动后,点击左下角状态栏「页面: x/y」按钮无法展开 Outline 侧边栏。根因:PR #4227 引入的
outline_sidebar_enabled()检查错误地把「视图显隐偏好」与「大纲数据模型加载」绑定在一起——偏好为 off 时loadDocumentOutline/setOutline直接bridge_->clear()清空数据,导致hasContent()恒为 false;用户点击按钮虽将偏好切为 on,但update_visibility里new_pdfOutlineVisibility = hasContent()仍为 false,侧边栏无法显示(数据死锁)。修复
qt_pdf_outline_widget.cpp):setOutline/loadDocumentOutline始终填充大纲数据模型,仅按偏好设置setVisible,保证hasContent()如实反映文档大纲qt_tm_widget.cpp):toggle_outline_sidebar在编辑器模式下展开时主动loadDocumentOutline(),确保展开时数据就绪qt_tm_widget.cppSLOT_FILE):编辑器模式下显式同步setVisible(hasContent())test_setOutline_preference_off,验证偏好 off 时数据保留(hasContent()为 true)且控件隐藏(isVisible()为 false)测试
xmake b qt_outline_widget_test && xmake r qt_outline_widget_test(23 passed)gf fmt --changed-since=main(无格式问题)任务文档:dev-agent 仓库 devel/6241.stem