Improve HTile(Delegate) paddings
This commit is contained in:
parent
36a214bf1a
commit
0d25c4caeb
|
@ -5,6 +5,8 @@ import ".."
|
||||||
|
|
||||||
HButton {
|
HButton {
|
||||||
id: tile
|
id: tile
|
||||||
|
topPadding: padded ? spacing / (compact ? 4 : 2) : 0
|
||||||
|
bottomPadding: topPadding
|
||||||
|
|
||||||
|
|
||||||
signal leftClicked()
|
signal leftClicked()
|
||||||
|
@ -21,16 +23,6 @@ HButton {
|
||||||
Behavior on topPadding { HNumberAnimation {} }
|
Behavior on topPadding { HNumberAnimation {} }
|
||||||
Behavior on bottomPadding { HNumberAnimation {} }
|
Behavior on bottomPadding { HNumberAnimation {} }
|
||||||
|
|
||||||
Binding on topPadding {
|
|
||||||
value: spacing / 4
|
|
||||||
when: compact
|
|
||||||
}
|
|
||||||
|
|
||||||
Binding on bottomPadding {
|
|
||||||
value: spacing / 4
|
|
||||||
when: compact
|
|
||||||
}
|
|
||||||
|
|
||||||
TapHandler {
|
TapHandler {
|
||||||
acceptedButtons: Qt.LeftButton
|
acceptedButtons: Qt.LeftButton
|
||||||
onTapped: leftClicked()
|
onTapped: leftClicked()
|
||||||
|
|
|
@ -6,6 +6,11 @@ import ".."
|
||||||
|
|
||||||
HTile {
|
HTile {
|
||||||
id: tile
|
id: tile
|
||||||
|
topPadding:
|
||||||
|
padded ? spacing / (firstInSection ? 1 : 2) / (compact ? 2 : 1) : 0
|
||||||
|
bottomPadding:
|
||||||
|
padded ? spacing / (lastInSection ? 1 : 2) / (compact ? 2 : 1) : 0
|
||||||
|
|
||||||
onLeftClicked: {
|
onLeftClicked: {
|
||||||
view.highlightRangeMode = ListView.NoHighlightRange
|
view.highlightRangeMode = ListView.NoHighlightRange
|
||||||
view.highlightMoveDuration = 0
|
view.highlightMoveDuration = 0
|
||||||
|
@ -18,4 +23,9 @@ HTile {
|
||||||
signal activated()
|
signal activated()
|
||||||
|
|
||||||
property HListView view: ListView.view
|
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