Skip to content

Commit c2e32f6

Browse files
wjyrichdeepin-bot[bot]
authored andcommitted
fix: adjust folder grid item height consistency
1. Added id 'folderGrid' to GridLayout for better reference 2. Added Layout.maximumHeight constraint to ensure consistent icon heights 3. Calculated maximum height based on parent height and row spacing 4. Maintains visual consistency in folder grid layouts fix: 调整文件夹网格项高度一致性 1. 为 GridLayout 添加 id 'folderGrid' 以便更好引用 2. 添加 Layout.maximumHeight 约束确保图标高度一致 3. 基于父高度和行间距计算最大高度 4. 保持文件夹网格布局的视觉一致性 Pms: BUG-320943
1 parent bcf2a1d commit c2e32f6

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

qml/IconItemDelegate.qml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ Control {
123123
radius: 12
124124

125125
GridLayout {
126+
id: folderGrid
126127
anchors.fill: parent
127128
rows: 2
128129
columns: 2
@@ -138,6 +139,9 @@ Control {
138139
Layout.fillWidth: true
139140
Layout.alignment: Qt.AlignTop | Qt.AlignLeft
140141

142+
// 添加最大高度限制,确保图标高度一致
143+
Layout.maximumHeight: Math.max(0, parent.height / 2 - folderGrid.rowSpacing / 2)
144+
141145
name: modelData
142146
sourceSize: Qt.size(root.maxIconSizeInFolder, root.maxIconSizeInFolder)
143147
scale: parent.width / 2 / root.maxIconSizeInFolder

0 commit comments

Comments
 (0)