Improve HTile(Delegate) paddings
This commit is contained in:
parent
36a214bf1a
commit
0d25c4caeb
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user