Conversation
1. Root cause: arrow buttons visible only bound to listView.interactive, missing atYBeginning/atYEnd checks 2. Fix: add !listView.atYBeginning to upButton visible and !listView.atYEnd to downButton visible binding 3. Impact: arrows hide at list top/bottom, no change when list has fewer items than maxVisibleItems Log: Fix scroll arrows not hiding at list boundaries in timezone popup Influence: 1. Test timezone list with more than 10 items, scroll to top and verify up arrow hides 2. Scroll to bottom and verify down arrow hides 3. Verify arrows reappear when scrolling back to middle 4. Verify arrows hidden when list has fewer than 10 items fix: 修复时区列表箭头在列表边界不隐藏的问题 1. 根因:箭头按钮 visible 仅绑定 listView.interactive,缺少 atYBeginning/atYEnd 滚动位置判断 2. 方案:上箭头 visible 追加 !listView.atYBeginning,下箭头追加 !listView.atYEnd,利用 Qt Quick ListView 标准属性 3. 影响:箭头在列表顶部/底部自动隐藏,列表项数不足时不显示 Log: 修复时区列表滚动到顶部或底部时箭头不消失的问题 Influence: 1. 测试时区列表超过 10 项时滚动到顶部,验证上箭头消失 2. 滚动到底部,验证下箭头消失 3. 从中间位置滚动验证箭头正确切换显隐 4. 验证列表项数不足 10 项时上下箭头均不显示 PMS: BUG-333099
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mhduiy 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 |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideUpdates the timezone selection popup to hide the up arrow at the list’s top and the down arrow at its bottom, while preserving the existing behavior for non-scrollable and mid-scroll states. State diagram for timezone list arrow visibilitystateDiagram-v2
[*] --> NonScrollable
NonScrollable --> NonScrollable: listView.interactive = false
ScrollableMiddle --> Top: listView.atYBeginning
ScrollableMiddle --> Bottom: listView.atYEnd
Top --> ScrollableMiddle: !listView.atYBeginning
Bottom --> ScrollableMiddle: !listView.atYEnd
state NonScrollable {
upButton: hidden
downButton: hidden
}
state Top {
upButton: hidden
downButton: visible
}
state ScrollableMiddle {
upButton: visible
downButton: visible
}
state Bottom {
upButton: visible
downButton: hidden
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
Author
|
这里上下箭头消失会导致布局跳动,保持原有设计,滚动到顶部或者底部的时候设置为disable的状态 |
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.
Root Cause Analysis
In the timezone selection popup (
SearchableListViewPopup.qml), the up/down scroll arrow buttons'visibleproperty was bound only tolistView.interactive(whether the list is scrollable), without checking the scroll position. This means the arrows remained visible even when the user scrolled to the top or bottom of the list. The down arrow hadenabled: !listView.atYEndbutvisiblewas stilltrue, so it only grayed out instead of disappearing.Key evidence:
SearchableListViewPopup.qml:187(up arrow) and:265(down arrow) both hadvisible: listView.interactivewithoutatYBeginning/atYEndboundary checks.Fix
Added
!listView.atYBeginningto the up arrow'svisiblebinding and!listView.atYEndto the down arrow'svisiblebinding, using Qt Quick ListView standard read-only properties. Only 2 lines changed, no new dependencies or refactoring.Change Safety Assessment
Code Safety
f4845fcc, DTK Popup replacement), not a previous bug fix — this change does not revert any historical fixupButton/downButtonQML component IDs; changes are local to the popup componentBusiness Impact Scope
The change affects the timezone list popup in Control Center's Date & Time module. When the list has more than 10 items (scrollable), scrolling to the top now hides the up arrow and scrolling to the bottom hides the down arrow. When the list has fewer than 10 items, both arrows remain hidden (unchanged behavior). The ColumnLayout automatically redistributes space when arrows become invisible, so popup height stays the same.
Verification Suggestion
Test the timezone list popup with more than 10 items: scroll to top/bottom and verify arrows hide, then scroll back to middle and verify arrows reappear. Also verify arrows stay hidden when the list has fewer than 10 items.
根因分析
在时区选择弹窗(
SearchableListViewPopup.qml)中,上下滚动箭头按钮的visible属性仅绑定了listView.interactive(列表是否可滚动),未检查滚动位置。这导致用户滚动到列表顶部或底部时箭头仍然可见。下箭头虽有enabled: !listView.atYEnd但visible仍为true,仅变灰未消失。关键证据:
SearchableListViewPopup.qml:187(上箭头)和:265(下箭头)的visible绑定均缺少atYBeginning/atYEnd边界判断。修复方案
在上箭头
visible绑定中追加!listView.atYBeginning,在下箭头visible绑定中追加!listView.atYEnd,利用 Qt Quick ListView 标准只读属性。仅改动 2 行,无新依赖或重构。改动安全评估
代码安全评估
f4845fcc,DTK Popup 替换)引入,非历史 bug 修复产物——本次修改不会撤销历史修复upButton/downButton组件 ID,改动局限于弹窗组件内部业务影响范围
改动影响控制中心时间和日期模块的时区列表弹窗。列表超过 10 项(可滚动)时,滚动到顶部隐藏上箭头、滚动到底部隐藏下箭头。列表不足 10 项时两个箭头均不显示(行为不变)。箭头不可见时 ColumnLayout 自动重新分配空间,弹窗高度不变。
验证建议
测试时区列表弹窗超过 10 项时:滚动到顶部/底部验证箭头消失,滚回中间验证箭头重新出现。同时验证列表不足 10 项时箭头不显示。
Summary by Sourcery
Bug Fixes: