QmlDesigner: Correct item library spacings

Regression caused by db6ad528bb

Fixes: QDS-3855
Change-Id: I4a91a66fcfaf6cbd013bc54a65344cb7f3171798
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Mahmoud Badri
2021-03-19 18:47:22 +02:00
parent 1ad6133161
commit 9e960d09a3
2 changed files with 13 additions and 14 deletions

View File

@@ -159,8 +159,6 @@ ScrollView {
: StudioTheme.Values.themeTextColor
leftPadding: 0
rightPadding: 0
topPadding: 0
bottomPadding: 0
expanded: importExpanded
expandOnClick: false
onToggleExpand: {
@@ -184,8 +182,8 @@ ScrollView {
hideHeader: categoryModel.rowCount() <= 1
leftPadding: 0
rightPadding: 0
topPadding: 0
bottomPadding: 0
addTopPadding: categoryModel.rowCount() > 1
addBottomPadding: index != categoryModel.rowCount() - 1
caption: categoryName + " (" + itemModel.rowCount() + ")"
visible: categoryVisible
expanded: categoryExpanded

View File

@@ -40,15 +40,15 @@ Item {
property alias showArrow: arrow.visible
property int leftPadding: 8
property int topPadding: 4
property int rightPadding: 0
property int bottomPadding: 4
property bool expanded: true
property int level: 0
property int levelShift: 10
property bool hideHeader: false
property bool expandOnClick: true // if false, toggleExpand signal will be emitted instead
property bool addTopPadding: true
property bool addBottomPadding: true
onHideHeaderChanged:
{
@@ -120,11 +120,12 @@ Item {
readonly property alias contentItem: row
implicitHeight: Math.round(row.height + header.height + topRow.height + bottomRow.height)
implicitHeight: Math.round(row.height + header.height + topSpacer.height + bottomSpacer.height)
Row {
id: topRow
height: StudioTheme.Values.sectionHeadSpacerHeight
Item {
id: topSpacer
height: addTopPadding && row.height > 0 ? StudioTheme.Values.sectionHeadSpacerHeight : 0
anchors.top: header.bottom
}
@@ -134,12 +135,12 @@ Item {
anchors.leftMargin: section.leftPadding
anchors.right: parent.right
anchors.rightMargin: section.rightPadding
anchors.top: topRow.bottom
anchors.top: topSpacer.bottom
}
Row {
id: bottomRow
height: StudioTheme.Values.sectionHeadSpacerHeight
Item {
id: bottomSpacer
height: addBottomPadding && row.height > 0 ? StudioTheme.Values.sectionHeadSpacerHeight : 0
anchors.top: row.bottom
}