Fix account bar scrolling

All delegates must have the same padding, or the ListView doesn't know
how to scroll to a certain index anymore
This commit is contained in:
miruka 2020-05-01 12:26:32 -04:00
parent 194a5194a8
commit cc4a780865
2 changed files with 4 additions and 10 deletions

View File

@ -6,10 +6,8 @@ import ".."
HTile { HTile {
id: tile id: tile
topPadding: topPadding: padded ? spacing / (compact ? 4 : 2) : 0
padded ? spacing / (firstInSection ? 1 : 2) / (compact ? 2 : 1) : 0 bottomPadding: topPadding
bottomPadding:
padded ? spacing / (lastInSection ? 1 : 2) / (compact ? 2 : 1) : 0
onLeftClicked: { onLeftClicked: {
view.highlightRangeMode = ListView.NoHighlightRange view.highlightRangeMode = ListView.NoHighlightRange
@ -23,9 +21,4 @@ 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
} }

View File

@ -33,9 +33,10 @@ HListView {
section.property: "for_account" section.property: "for_account"
section.labelPositioning: section.labelPositioning:
ViewSection.InlineLabels | ViewSection.CurrentLabelAtStart ViewSection.InlineLabels | ViewSection.CurrentLabelAtStart
section.delegate: Account { section.delegate: Account {
accountModel: ModelStore.get("accounts").find(section)
width: roomList.width width: roomList.width
accountModel: ModelStore.get("accounts").find(section)
} }