Skip to content

fix(ArrowListView): keep arrows always visible and grey by scroll position - #726

Merged
18202781743 merged 1 commit into
linuxdeepin:v25-flowstylefrom
zqq-dora:fix-menu-arrow-always-visible
Oct 20, 2026
Merged

18202781743 merged 1 commit into
linuxdeepin:v25-flowstylefrom
zqq-dora:fix-menu-arrow-always-visible

Conversation

@zqq-dora

@zqq-dora zqq-dora commented Oct 19, 2026 •

Copy link
Copy Markdown

The up/down arrow buttons in ArrowListView used visible: itemsView.interactive, so they only appeared when the menu was
scrollable and vanished otherwise. Because the arrow Loaders also
relied on Layout.preferredHeight: implicitHeight, the Loader's
implicitHeight evaluated to 0 before the ActionButton incubated,
so the ColumnLayout gave the arrow 0 height and Qt marked it
invisible on first open -- the up arrow only reappeared after the
first scroll.

ArrowListView.qml

  • Remove visible: itemsView.interactive from both arrow Loaders
    so the arrows are always present and the menu height no longer
    jitters when toggling between scrollable and non-scrollable.
  • Replace Layout.preferredHeight: implicitHeight with the fixed
    DS.Style.arrowListView.stepButtonSize.height plus
    Layout.minimumHeight of the same value, so the layout reserves
    the arrow height from creation rather than collapsing to 0 while
    the ActionButton incubates.
  • Add spacing: 6 between the arrows and the list, and
    anchors.topMargin: 6 so the up arrow keeps 6 px from the
    search-box header.

ArrowListViewButton.qml

  • Set active: true so the ActionButton is always loaded, matching
    the always-visible behavior above.
  • Keep the existing position-based enabled binding
    (!view.atYBeginning / !view.atYEnd); disabled arrows grey
    through ActionButton's native disabled opacity, no custom DCI
    state needed.
  • Update copyright year range to 2022 - 2026.

Only the Qt6 (qt6/src/qml/) implementation is changed; Qt5 is left
unchanged as v25 ships Qt6 only.


修复搜索菜单上下箭头:箭头常驻显示并按滚动位置置灰

ArrowListView 的上下箭头之前使用 visible: itemsView.interactive,
只有菜单可滚动时才显示,否则消失。同时两个箭头 Loader 使用
Layout.preferredHeight: implicitHeight,而 Loader 在 ActionButton
孵化前 implicitHeight 为 0,导致 ColumnLayout 给箭头分配 0 高度、
Qt 判定其不可见——首次打开时上箭头不显示,要等滚动一次后才出现。

ArrowListView.qml

  • 删除两个箭头 Loader 的 visible: itemsView.interactive,箭头常驻,
    菜单高度不再因可滚动状态切换而抖动。
  • 将 Layout.preferredHeight: implicitHeight 替换为固定的
    DS.Style.arrowListView.stepButtonSize.height,并加同值的
    Layout.minimumHeight,使布局从创建起就为箭头预留高度,不再在
    ActionButton 孵化前塌成 0。
  • 新增 spacing: 6(箭头与列表间距)和 anchors.topMargin: 6
    (上箭头与搜索框 header 间距 6 px)。

ArrowListViewButton.qml

  • active 改为 true,与箭头常驻保持一致。
  • 保留原有的按位置判断的 enabled 绑定(!view.atYBeginning /
    !view.atYEnd),置灰通过 ActionButton 原生 disabled opacity 实现,
    无需额外 DCI disabled 状态。
  • 更新版权年份范围至 2022 - 2026。

仅修改 Qt6(qt6/src/qml/)实现,Qt5 保持不变,v25 仅使用 Qt6。

Summary by Sourcery

Ensure ArrowListView arrows remain consistently visible while reflecting whether further scrolling is available.

Bug Fixes:

  • Keep ArrowListView navigation arrows present from initial display and automatically grey them based on the current scroll position.

Enhancements:

  • Stabilize the menu layout by reserving arrow space and adding consistent spacing around the arrows and list.

Chores:

  • Update the Qt6 arrow button copyright year range.

@sourcery-ai

sourcery-ai Bot commented Oct 19, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

The Qt6 ArrowListView now keeps both arrows instantiated and visible with stable reserved dimensions, while disabling and greying them according to scroll position; spacing and implicit-height calculations were adjusted to prevent first-open collapse and menu-size jitter.

File-Level Changes

Change Details Files
Keep both navigation arrows loaded and reserve their layout space from creation.
  • Removed scrollability-based visibility gating.
  • Set fixed preferred and minimum heights from the design-system arrow size.
  • Added 6 px spacing between arrows and list, plus a 6 px top margin below the header.
  • Included the top margin in the component's implicit height.
qt6/src/qml/ArrowListView.qml
Make arrow buttons always instantiated while preserving position-based disabled styling.
  • Set the button Loader active unconditionally.
  • Retained enabled bindings based on the view's top and bottom scroll positions, allowing native disabled opacity to grey arrows.
  • Updated the copyright year range.
qt6/src/qml/private/ArrowListViewButton.qml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@deepin-ci-robot

Copy link
Copy Markdown
Contributor

Hi @zqq-dora. Thanks for your PR.

I'm waiting for a linuxdeepin member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread qt6/src/qml/private/ArrowListViewButton.qml
@zqq-dora
zqq-dora force-pushed the fix-menu-arrow-always-visible branch from 7ebabe6 to 1630e77 Compare October 20, 2026 07:40
…ition

The up/down arrow buttons in ArrowListView used `visible:
itemsView.interactive`, so they only appeared when the menu was
scrollable and vanished otherwise. Because the arrow Loaders also
relied on `Layout.preferredHeight: implicitHeight`, the Loader's
implicitHeight evaluated to 0 before the ActionButton incubated,
so the ColumnLayout gave the arrow 0 height and Qt marked it
invisible on first open -- the up arrow only reappeared after the
first scroll.

ArrowListView.qml
- Remove `visible: itemsView.interactive` from both arrow Loaders
  so the arrows are always present and the menu height no longer
  jitters when toggling between scrollable and non-scrollable.
- Replace `Layout.preferredHeight: implicitHeight` with the fixed
  `DS.Style.arrowListView.stepButtonSize.height` plus
  `Layout.minimumHeight` of the same value, so the layout reserves
  the arrow height from creation rather than collapsing to 0 while
  the ActionButton incubates.
- Add `spacing: 6` between the arrows and the list, and
  `anchors.topMargin: 6` so the up arrow keeps 6 px from the
  search-box header.

ArrowListViewButton.qml
- Set `active: true` so the ActionButton is always loaded, matching
  the always-visible behavior above.
- Keep the existing position-based `enabled` binding
  (`!view.atYBeginning` / `!view.atYEnd`); disabled arrows grey
  through ActionButton's native disabled opacity, no custom DCI
  state needed.
- Update copyright year range to 2022 - 2026.

Only the Qt6 (qt6/src/qml/) implementation is changed; Qt5 is left
unchanged as v25 ships Qt6 only.

---

修复搜索菜单上下箭头:箭头常驻显示并按滚动位置置灰

ArrowListView 的上下箭头之前使用 `visible: itemsView.interactive`,
只有菜单可滚动时才显示,否则消失。同时两个箭头 Loader 使用
`Layout.preferredHeight: implicitHeight`,而 Loader 在 ActionButton
孵化前 implicitHeight 为 0,导致 ColumnLayout 给箭头分配 0 高度、
Qt 判定其不可见——首次打开时上箭头不显示,要等滚动一次后才出现。

ArrowListView.qml
- 删除两个箭头 Loader 的 `visible: itemsView.interactive`,箭头常驻,
  菜单高度不再因可滚动状态切换而抖动。
- 将 `Layout.preferredHeight: implicitHeight` 替换为固定的
  `DS.Style.arrowListView.stepButtonSize.height`,并加同值的
  `Layout.minimumHeight`,使布局从创建起就为箭头预留高度,不再在
  ActionButton 孵化前塌成 0。
- 新增 `spacing: 6`(箭头与列表间距)和 `anchors.topMargin: 6`
  (上箭头与搜索框 header 间距 6 px)。

ArrowListViewButton.qml
- `active` 改为 `true`,与箭头常驻保持一致。
- 保留原有的按位置判断的 `enabled` 绑定(`!view.atYBeginning` /
  `!view.atYEnd`),置灰通过 ActionButton 原生 disabled opacity 实现,
  无需额外 DCI disabled 状态。
- 更新版权年份范围至 2022 - 2026。

仅修改 Qt6(qt6/src/qml/)实现,Qt5 保持不变,v25 仅使用 Qt6。
@zqq-dora
zqq-dora force-pushed the fix-menu-arrow-always-visible branch from 1630e77 to 0584101 Compare October 20, 2026 08:53
@zqq-dora

Copy link
Copy Markdown
Author

已修正 sizedHeight 公式,对齐改动后的实际布局,消除 ComboBox 下拉打开时的 popup 高度抖动:

  • 箭头区高度从 stepButtonIconSize.height(12) 改为 stepButtonSize.height(16),与实际箭头按钮高度一致
  • 去掉 itemsView.count > maxVisibleItems 条件分支,因箭头已常驻,短菜单也占位,公式需无条件计入箭头区
  • 补上之前漏算的 contentLayout.anchors.topMargin(6),与实际布局顶部间距对齐

Comment thread qt6/src/qml/ArrowListView.qml
@deepin-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, zqq-dora

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@18202781743
18202781743 merged commit ebe0f72 into linuxdeepin:v25-flowstyle Oct 20, 2026
18 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants