diff --git a/src/gui/Base/HTile/HTile.qml b/src/gui/Base/HTile/HTile.qml index 5610f4e6..f83ac452 100644 --- a/src/gui/Base/HTile/HTile.qml +++ b/src/gui/Base/HTile/HTile.qml @@ -5,6 +5,8 @@ import ".." HButton { id: tile + topPadding: padded ? spacing / (compact ? 4 : 2) : 0 + bottomPadding: topPadding signal leftClicked() @@ -21,16 +23,6 @@ HButton { Behavior on topPadding { HNumberAnimation {} } Behavior on bottomPadding { HNumberAnimation {} } - Binding on topPadding { - value: spacing / 4 - when: compact - } - - Binding on bottomPadding { - value: spacing / 4 - when: compact - } - TapHandler { acceptedButtons: Qt.LeftButton onTapped: leftClicked() diff --git a/src/gui/Base/HTile/HTileDelegate.qml b/src/gui/Base/HTile/HTileDelegate.qml index cf0ec20c..b0a0bbb3 100644 --- a/src/gui/Base/HTile/HTileDelegate.qml +++ b/src/gui/Base/HTile/HTileDelegate.qml @@ -6,6 +6,11 @@ import ".." HTile { id: tile + topPadding: + padded ? spacing / (firstInSection ? 1 : 2) / (compact ? 2 : 1) : 0 + bottomPadding: + padded ? spacing / (lastInSection ? 1 : 2) / (compact ? 2 : 1) : 0 + onLeftClicked: { view.highlightRangeMode = ListView.NoHighlightRange view.highlightMoveDuration = 0 @@ -18,4 +23,9 @@ HTile { signal activated() property HListView view: ListView.view + + readonly property bool firstInSection: + ListView.previousSection !== ListView.section + readonly property bool lastInSection: + ListView.nextSection !== ListView.section }