Commit 0214421
fix: prevent background type from overriding custom item spacing
1. Changed DStyledItemDelegate to initialize itemSpacing with -1 as
default value
2. Added spacing() method to handle negative spacing values
3. Modified setBackgroundType to only set spacing when no custom spacing
was set (spacing < 0)
4. Updated all spacing references to use the new spacing() method
Log: Fixed issue where setting background type would override custom
item spacing values
Influence:
1. Test setting custom item spacing values before/after changing
background types
2. Verify spacing behavior with different background types
(RoundedBackground, ClipCornerBackground)
3. Check layout calculations with custom spacing values
4. Test list view rendering in both LeftToRight and TopToBottom flows
fix: 修复设置背景类型会覆盖自定义间距值的问题
1. 修改 DStyledItemDelegate 默认将 itemSpacing 初始化为 -1
2. 新增 spacing() 方法处理负间距值
3. 修改 setBackgroundType 仅在未设置自定义间距时(spacing < 0)才设置
间距
4. 更新所有间距引用使用新的 spacing() 方法
Log: 修复了设置背景类型会覆盖自定义间距值的问题
Influence:
1. 测试在更改背景类型前后设置自定义间距值
2. 验证不同背景类型(RoundedBackground, ClipCornerBackground)下的间距行为
3. 检查使用自定义间距值时的布局计算
4. 测试列表视图在 LeftToRight 和 TopToBottom 两种流式布局下的渲染效果1 parent bee46d5 commit 0214421
2 files changed
+18
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
777 | 777 | | |
778 | 778 | | |
779 | 779 | | |
780 | | - | |
781 | | - | |
782 | | - | |
783 | | - | |
784 | | - | |
785 | | - | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
786 | 786 | | |
787 | 787 | | |
788 | 788 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
516 | 516 | | |
517 | 517 | | |
518 | 518 | | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
519 | 526 | | |
520 | 527 | | |
521 | 528 | | |
522 | | - | |
| 529 | + | |
523 | 530 | | |
524 | 531 | | |
525 | 532 | | |
| |||
1176 | 1183 | | |
1177 | 1184 | | |
1178 | 1185 | | |
1179 | | - | |
| 1186 | + | |
1180 | 1187 | | |
1181 | | - | |
| 1188 | + | |
1182 | 1189 | | |
1183 | 1190 | | |
1184 | 1191 | | |
| |||
1353 | 1360 | | |
1354 | 1361 | | |
1355 | 1362 | | |
1356 | | - | |
| 1363 | + | |
1357 | 1364 | | |
1358 | | - | |
| 1365 | + | |
1359 | 1366 | | |
1360 | 1367 | | |
1361 | 1368 | | |
| |||
0 commit comments