Repository navigation
fix(ArrowListView): keep arrows always visible and grey by scroll position - #726
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThe 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
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
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 Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
7ebabe6 to
1630e77
Compare
…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。
1630e77 to
0584101
Compare
|
已修正 sizedHeight 公式,对齐改动后的实际布局,消除 ComboBox 下拉打开时的 popup 高度抖动:
|
|
[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. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
ebe0f72
into
linuxdeepin:v25-flowstyle
The up/down arrow buttons in ArrowListView used
visible: itemsView.interactive, so they only appeared when the menu wasscrollable and vanished otherwise. Because the arrow Loaders also
relied on
Layout.preferredHeight: implicitHeight, the Loader'simplicitHeight 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
visible: itemsView.interactivefrom both arrow Loadersso the arrows are always present and the menu height no longer
jitters when toggling between scrollable and non-scrollable.
Layout.preferredHeight: implicitHeightwith the fixedDS.Style.arrowListView.stepButtonSize.heightplusLayout.minimumHeightof the same value, so the layout reservesthe arrow height from creation rather than collapsing to 0 while
the ActionButton incubates.
spacing: 6between the arrows and the list, andanchors.topMargin: 6so the up arrow keeps 6 px from thesearch-box header.
ArrowListViewButton.qml
active: trueso the ActionButton is always loaded, matchingthe always-visible behavior above.
enabledbinding(
!view.atYBeginning/!view.atYEnd); disabled arrows greythrough ActionButton's native disabled opacity, no custom DCI
state needed.
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
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 状态。
仅修改 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:
Enhancements:
Chores: