Skip to content

[6025] 左侧大纲侧边栏添加按需显示的滚动条 - #4737

Merged
da-liii merged 1 commit into
mainfrom
da/6025/outline_scrollbar
Oct 16, 2026
Merged

da-liii merged 1 commit into
mainfrom
da/6025/outline_scrollbar

Conversation

@MoonL79

@MoonL79 MoonL79 commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

任务简述

为 STEM 左侧大纲侧边栏(OutlineSidebar.qml)新增轻量级原生按需显示的垂直滚动条,提升长文档及多级大纲目录导航体验。

改动点

  1. 按需显示控制:
    • 基于 ListView.visibleArea.heightRatio < 0.9999 与内容条目数判断,大纲内容未溢出时不显示滚动条,避免视觉冗余;
    • 搜索过滤或折叠导致条目减少至视口内时自动隐藏,展开或窗口缩小导致溢出时自动呈现。
  2. 滚动条几何与视觉:
    • 浮层(Overlay)设计置于最右侧,不挤占正文与页码排版宽度;
    • 最小滑块高度保护(24px * scaleFactor),超长列表下依然易于识别与点击;
    • 支持浅色(半透明中性灰)与深色(半透明灰白)主题切换与 Hover 高亮反馈。
  3. 交互支持:
    • 鼠标滚轮双向联动;
    • 支持拖拽滑块快速定位大纲位置;
    • 支持点击滑块上方/下方轨道空白区域进行按页快速翻转。
  4. 单元测试补充:
    • 在 tests/Plugins/Qt/qt_outline_widget_test.cpp 增加 test_scrollbar_visibility_and_interaction 完整覆盖滚动条显示隐藏、翻页、拖拽联动、搜索联动与清空隐藏测试。

@da-liii
da-liii merged commit 48b3c0f into main Oct 16, 2026
6 checks passed
@da-liii
da-liii deleted the da/6025/outline_scrollbar branch October 16, 2026 08:50
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.

2 participants