Repository navigation
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
|
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. |
Reviewer's GuideData structuresDefine the scrollbar sizing, radius, opacity, and border style tokens that the control consumes.
UIApply the orientation-specific widths and per-state radii in the ScrollBar control, including its default content width.
Make the exhibition scrollbar examples visible in both themes by using theme-aware frame and content colors.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 3 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="qt6/src/qml/ScrollBar.qml" line_range="58" />
<code_context>
PropertyChanges {
target: control.contentItem
- implicitWidth: DS.Style.scrollBar.width
+ implicitWidth: control.orientation == Qt.Horizontal ? DS.Style.scrollBar.horizontalWidth : DS.Style.scrollBar.width
opacity: DS.Style.scrollBar.hideOpacity
}
</code_context>
<issue_to_address>
**Older style overrides lose scrollbar sizing**
When an application supplies a style override based on the previous scroll-bar token set, a custom `DS.Style` based on the previous token set has no `horizontalWidth`, `hoverWidth`, or `normalRadius`; these bindings then read missing properties, leaving scrollbar dimensions or radii invalid and breaking rendering for applications using that override.
Provide backward-compatible fallbacks for the new tokens or preserve the old style shape when resolving scrollbar values.
Also at `qt6/src/qml/ScrollBar.qml:83`, `qt6/src/qml/ScrollBar.qml:125`.
</issue_to_address>
### Comment 2
<location path="qt6/src/qml/FlowStyle.qml" line_range="858" />
<code_context>
+ property int width: 6
+ property int horizontalWidth: 4
property int activeWidth: 12
+ property int hoverWidth: 14
+ property int horizontalHoverWidth: 12
+ property int normalRadius: 4
</code_context>
<issue_to_address>
**Scrollbar narrows on press**
When a vertical scrollbar transitions from hover to pressed, the hover state uses `hoverWidth` 14 while the pressed state uses `activeWidth` 12; `OutsideBoxBorder` adds 1px on each side, so the bar goes from 16px to 14px and visibly narrows on press.
Set the vertical pressed width to match the hover width.
Also at `qt6/src/qml/ScrollBar.qml:83`.
</issue_to_address>
### Comment 3
<location path="examples/exhibition/ScrollBar.qml" line_range="11" />
<code_context>
Column {
id: panel
+
+ property bool darkMode: ApplicationHelper.n === ApplicationHelper.DarkType
+ property color bgColor: darkMode ? "#1b1b1b" : "#ffffff"
+ property color borderColor: darkMode ? "#3d3d3d" : "#cacaca"
</code_context>
<issue_to_address>
**Demo keeps light-mode colors**
When the exhibition is shown in dark mode, `ApplicationHelper.n` does not expose the current theme, so `darkMode` remains false and `bgColor`, `borderColor`, and `contentBgColor` keep their light-mode values; the demo's surfaces and scrollbar borders lose contrast.
Bind `darkMode` to the exposed theme property instead of `ApplicationHelper.n`.
</issue_to_address>| PropertyChanges { | ||
| target: control.contentItem | ||
| implicitWidth: DS.Style.scrollBar.width | ||
| implicitWidth: control.orientation == Qt.Horizontal ? DS.Style.scrollBar.horizontalWidth : DS.Style.scrollBar.width |
There was a problem hiding this comment.
🟡 Medium · Older style overrides lose scrollbar sizing
When an application supplies a style override based on the previous scroll-bar token set, a custom DS.Style based on the previous token set has no horizontalWidth, hoverWidth, or normalRadius; these bindings then read missing properties, leaving scrollbar dimensions or radii invalid and breaking rendering for applications using that override.
Provide backward-compatible fallbacks for the new tokens or preserve the old style shape when resolving scrollbar values.
Also at qt6/src/qml/ScrollBar.qml:83, qt6/src/qml/ScrollBar.qml:125.
Prompt for AI agents
In `qt6/src/qml/ScrollBar.qml` at line 58:
**Older style overrides lose scrollbar sizing**
When an application supplies a style override based on the previous scroll-bar token set, a custom `DS.Style` based on the previous token set has no `horizontalWidth`, `hoverWidth`, or `normalRadius`; these bindings then read missing properties, leaving scrollbar dimensions or radii invalid and breaking rendering for applications using that override.
Provide backward-compatible fallbacks for the new tokens or preserve the old style shape when resolving scrollbar values.
Also at `qt6/src/qml/ScrollBar.qml:83`, `qt6/src/qml/ScrollBar.qml:125`.| property int width: 6 | ||
| property int horizontalWidth: 4 | ||
| property int activeWidth: 12 | ||
| property int hoverWidth: 14 |
There was a problem hiding this comment.
🟡 Medium · Scrollbar narrows on press
When a vertical scrollbar transitions from hover to pressed, the hover state uses hoverWidth 14 while the pressed state uses activeWidth 12; OutsideBoxBorder adds 1px on each side, so the bar goes from 16px to 14px and visibly narrows on press.
Set the vertical pressed width to match the hover width.
Also at qt6/src/qml/ScrollBar.qml:83.
Prompt for AI agents
In `qt6/src/qml/FlowStyle.qml` at line 858:
**Scrollbar narrows on press**
When a vertical scrollbar transitions from hover to pressed, the hover state uses `hoverWidth` 14 while the pressed state uses `activeWidth` 12; `OutsideBoxBorder` adds 1px on each side, so the bar goes from 16px to 14px and visibly narrows on press.
Set the vertical pressed width to match the hover width.
Also at `qt6/src/qml/ScrollBar.qml:83`.| Column { | ||
| id: panel | ||
|
|
||
| property bool darkMode: ApplicationHelper.n === ApplicationHelper.DarkType |
There was a problem hiding this comment.
🟡 Medium · Demo keeps light-mode colors
When the exhibition is shown in dark mode, ApplicationHelper.n does not expose the current theme, so darkMode remains false and bgColor, borderColor, and contentBgColor keep their light-mode values; the demo's surfaces and scrollbar borders lose contrast.
Bind darkMode to the exposed theme property instead of ApplicationHelper.n.
Prompt for AI agents
In `examples/exhibition/ScrollBar.qml` at line 11:
**Demo keeps light-mode colors**
When the exhibition is shown in dark mode, `ApplicationHelper.n` does not expose the current theme, so `darkMode` remains false and `bgColor`, `borderColor`, and `contentBgColor` keep their light-mode values; the demo's surfaces and scrollbar borders lose contrast.
Bind `darkMode` to the exposed theme property instead of `ApplicationHelper.n`.Refactor ScrollBar to distinguish vertical and horizontal widths, fix opacity values, and use dedicated radius tokens instead of dynamic height/2 or width/2. Style tokens (qt6/src/qml/FlowStyle.qml): - Vertical width 4 -> 6; add horizontalWidth: 4 for slimmer horizontal bars - Add hoverWidth: 14 and horizontalHoverWidth: 12 for orientation-aware hover sizing (previously both used activeWidth: 12) - Add normalRadius: 4 (hide/normal) and radius: 6 (hover/pressed), replacing dynamic height/2 or width/2 - Background opacity: normal 0.3 -> 0.5, hovered 0.4 -> 0.7; hoveredDark 0.6 -> 0.7 - insideBorder: normalDark 0.1 -> 0.05; add hoveredDark (0.1) and pressedDark (0.05) Control (qt6/src/qml/ScrollBar.qml): - hide / normal / hover states use orientation-aware width tokens - pressed (active) state keeps activeWidth: 12; with 1px border on each side the visual width is 14, matching hover - All four states now drive backgroundRect.radius: normalRadius (4) for hide/normal, radius (6) for hover/pressed, replacing the old dynamic height/2 / width/2 - contentItem.implicitWidth default is orientation-aware Exhibition demo (examples/exhibition/ScrollBar.qml): - Add theme-aware border and content background colors via ApplicationHelper.n so scrollbars are visible in both light and dark modes - Fix "D is not defined" ReferenceError by replacing D.DTK.themeType / D.ApplicationHelper with correct unqualified QML references 重构 ScrollBar 样式,区分垂直和水平方向宽度,修正透明度,并使用独立的 圆角参数替代动态的 height/2 / width/2。 样式参数 (qt6/src/qml/FlowStyle.qml): - 垂直宽度 4 -> 6;新增 horizontalWidth: 4,水平滚动条保持纤细 - 新增 hoverWidth: 14 和 horizontalHoverWidth: 12,区分方向的 hover 宽度 (之前统一用 activeWidth: 12) - 新增 normalRadius: 4(隐藏/正常态)和 radius: 6(hover/pressed 态), 取代动态的 height/2 / width/2 - 背景透明度:normal 0.3 -> 0.5,hover 0.4 -> 0.7;hoveredDark 0.6 -> 0.7 - insideBorder:normalDark 0.1 -> 0.05;新增 hoveredDark (0.1) 和 pressedDark (0.05) 控件 (qt6/src/qml/ScrollBar.qml): - 隐藏 / 正常 / hover 状态使用方向感知的宽度参数 - pressed(active)状态保持 activeWidth: 12;加上两侧各 1px 外描边, 视觉宽度为 14,与 hover 一致 - 四个状态均驱动 backgroundRect.radius:隐藏/正常用 normalRadius (4), hover/pressed 用 radius (6),取代旧的动态 height/2 / width/2 - contentItem.implicitWidth 默认值改为方向感知 Exhibition 示例 (examples/exhibition/ScrollBar.qml): - 通过 ApplicationHelper.n 添加主题感知的边框色和内容背景色,浅色和深色 模式下都能清楚看到滚动条 - 修复 D is not defined 的 ReferenceError,将 D.DTK.themeType / D.ApplicationHelper 替换为正确的无前缀 QML 引用
daccd89 to
260603c
Compare
|
这个pr是要合入master么? |
|
目标分支搞错了,应该合入 v25-flowstyle,已重新提 PR。 |
Refactor ScrollBar to distinguish vertical and horizontal widths, fix opacity values, and use dedicated radius tokens instead of dynamic height/2 or width/2.
Style tokens (qt6/src/qml/FlowStyle.qml):
horizontalWidth: 4for slimmer horizontal barshoverWidth: 14andhorizontalHoverWidth: 12for orientation-aware hover sizing (previously both usedactiveWidth: 12)normalRadius: 4(hide/normal) andradius: 6(hover/pressed), replacing dynamicheight/2orwidth/2Control (qt6/src/qml/ScrollBar.qml):
activeWidth: 12; with 1px border on each side the visual width is 14, matching hoverbackgroundRect.radius:normalRadius(4) for hide/normal,radius(6) for hover/pressed, replacing the old dynamicheight/2/width/2contentItem.implicitWidthdefault is orientation-awareExhibition demo (examples/exhibition/ScrollBar.qml):
ApplicationHelper.nso scrollbars are visible in both light and dark modesD is not definedReferenceError by replacingD.DTK.themeType/D.ApplicationHelperwith correct unqualified QML references重构 ScrollBar 样式,区分垂直和水平方向宽度,修正透明度,并使用独立的圆角参数替代动态的
height/2/width/2。样式参数 (qt6/src/qml/FlowStyle.qml):
horizontalWidth: 4,水平滚动条保持纤细hoverWidth: 14和horizontalHoverWidth: 12,区分方向的 hover 宽度(之前统一用activeWidth: 12)normalRadius: 4(隐藏/正常态)和radius: 6(hover/pressed 态),取代动态的height/2/width/2控件 (qt6/src/qml/ScrollBar.qml):
activeWidth: 12;加上两侧各 1px 外描边,视觉宽度为 14,与 hover 一致backgroundRect.radius:隐藏/正常用normalRadius(4),hover/pressed 用radius(6),取代旧的动态height/2/width/2contentItem.implicitWidth默认值改为方向感知Exhibition 示例 (examples/exhibition/ScrollBar.qml):
ApplicationHelper.n添加主题感知的边框色和内容背景色,浅色和深色模式下都能清楚看到滚动条D is not defined的 ReferenceError,将D.DTK.themeType/D.ApplicationHelper替换为正确的无前缀 QML 引用