2
0
mirror of synced 2025-02-01 01:07:28 +00:00

feat(StatusListItem): scroll feature added if list of tags exceeds component width

This commit is contained in:
Sale Djenic 2022-08-15 13:03:20 +02:00 committed by saledjenic
parent b9882c6ff6
commit b59295d56b
2 changed files with 39 additions and 10 deletions

View File

@ -342,16 +342,37 @@ CExPynn1gWf9bx498P7/nzPcxEzGExhBdJGYihtAYQlO+tUZvqrPbqeudo5iJGEJjCE15a3VtodH3q2I
StatusListItem { StatusListItem {
title: "List Item with Inline Tags" title: "List Item with Inline Tags"
icon.isLetterIdenticon: true icon.isLetterIdenticon: true
tagsModel : 2 tagsModel: ListModel{
ListElement {
name: "helloworld.eth"
emoji: "😁"
}
ListElement {
name: "account1"
emoji: "😁"
}
ListElement {
name: "account2"
emoji: "😁"
}
ListElement {
name: "account3"
emoji: "😁"
}
ListElement {
name: "account4"
emoji: "😁"
}
}
tagsDelegate: StatusListItemTag { tagsDelegate: StatusListItemTag {
color: "blue" color: "blue"
height: 24 height: 24
radius: 6 radius: 6
closeButtonVisible: false closeButtonVisible: false
icon.emoji: "😁" icon.emoji: model.emoji
icon.emojiSize: Emoji.size.verySmall icon.emojiSize: Emoji.size.verySmall
icon.isLetterIdenticon: true icon.isLetterIdenticon: true
title: "helloworld.eth" title: model.name
titleText.font.pixelSize: 12 titleText.font.pixelSize: 12
titleText.color: Theme.palette.indirectColor1 titleText.color: Theme.palette.indirectColor1
} }

View File

@ -30,7 +30,7 @@ Rectangle {
property list<Item> components property list<Item> components
property var bottomModel: [] property var bottomModel: []
property Component bottomDelegate property Component bottomDelegate
property var tagsModel: [] property alias tagsModel: tagsRepeater.model
property Component tagsDelegate property Component tagsDelegate
property bool loading: false property bool loading: false
property bool loadingFailed: false property bool loadingFailed: false
@ -317,19 +317,27 @@ Rectangle {
implicitHeight: visible ? 22 : 0 implicitHeight: visible ? 22 : 0
} }
Row { ScrollView {
id: statusListItemTagsSlotInline visible: tagsRepeater.count > 0
anchors.top: statusListItemTertiaryTitle.bottom anchors.top: statusListItemTertiaryTitle.bottom
anchors.topMargin: visible? 8 : 0
width: parent.width width: parent.width
spacing: 10 height: visible? contentHeight + 12 : contentHeight
clip: true clip: true
ScrollBar.vertical.policy: ScrollBar.AlwaysOff
Row {
id: statusListItemTagsSlotInline
spacing: 10
Repeater { Repeater {
model: tagsModel id: tagsRepeater
delegate: tagsDelegate delegate: tagsDelegate
} }
} }
} }
}
Row { Row {
id: statusListItemTagsSlot id: statusListItemTagsSlot