feat(StatusListItem): Add tags model under subtitle in a list item

This commit is contained in:
Khushboo Mehta 2022-03-28 10:16:03 +02:00
parent a99e5e0201
commit 2a1c11eb15
4 changed files with 40 additions and 5 deletions

View File

@ -4,6 +4,7 @@ import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1 import StatusQ.Core.Theme 0.1
import StatusQ.Controls 0.1 import StatusQ.Controls 0.1
import StatusQ.Components 0.1 import StatusQ.Components 0.1
import StatusQ.Core.Utils 0.1
GridLayout { GridLayout {
columns: 1 columns: 1
@ -338,6 +339,24 @@ CExPynn1gWf9bx498P7/nzPcxEzGExhBdJGYihtAYQlO+tUZvqrPbqeudo5iJGEJjCE15a3VtodH3q2I
} }
} }
StatusListItem {
title: "List Item with Inline Tags"
icon.isLetterIdenticon: true
tagsModel : 2
tagsDelegate: StatusListItemTag {
color: "blue"
height: 24
radius: 6
closeButtonVisible: false
icon.emoji: "😁"
icon.emojiSize: Emoji.size.verySmall
icon.isLetterIdenticon: true
title: "helloworld.eth"
titleText.font.pixelSize: 12
titleText.color: Theme.palette.indirectColor1
}
}
StatusListItem { StatusListItem {
title: "List Item with Emoji" title: "List Item with Emoji"
subTitle: "Emoji" subTitle: "Emoji"

View File

@ -12,6 +12,7 @@ Rectangle {
property alias additionalText: additionalText.text property alias additionalText: additionalText.text
property alias button: button property alias button: button
property alias expandableComponent: expandableRegion.sourceComponent property alias expandableComponent: expandableRegion.sourceComponent
property alias expandableItem: expandableRegion.item
property int type: StatusExpandableItem.Type.Primary property int type: StatusExpandableItem.Type.Primary
property bool expandable: true property bool expandable: true
@ -185,7 +186,7 @@ Rectangle {
anchors.leftMargin: (statusExpandableItem.type === StatusExpandableItem.Type.Primary) ? 48 : 0 anchors.leftMargin: (statusExpandableItem.type === StatusExpandableItem.Type.Primary) ? 48 : 0
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: (statusExpandableItem.type === StatusExpandableItem.Type.Primary) ? 16 : 0 anchors.rightMargin: (statusExpandableItem.type === StatusExpandableItem.Type.Primary) ? 16 : 0
active: false visible: false
} }
onExpandedChanged: { onExpandedChanged: {
@ -202,13 +203,13 @@ Rectangle {
name: "EXPANDED" name: "EXPANDED"
PropertyChanges {target: expandImage; icon: "chevron-up"} PropertyChanges {target: expandImage; icon: "chevron-up"}
PropertyChanges {target: statusExpandableItem; height: 82 + expandableRegion.height + 22} PropertyChanges {target: statusExpandableItem; height: 82 + expandableRegion.height + 22}
PropertyChanges {target: expandableRegion; active: true} PropertyChanges {target: expandableRegion; visible: true}
}, },
State { State {
name: "COLLAPSED" name: "COLLAPSED"
PropertyChanges {target: expandImage; icon: "chevron-down"} PropertyChanges {target: expandImage; icon: "chevron-down"}
PropertyChanges {target: statusExpandableItem; height: 82} PropertyChanges {target: statusExpandableItem; height: 82}
PropertyChanges {target: expandableRegion; active: false} PropertyChanges {target: expandableRegion; visible: false}
} }
] ]

View File

@ -25,6 +25,8 @@ 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 Component tagsDelegate
property StatusIconSettings icon: StatusIconSettings { property StatusIconSettings icon: StatusIconSettings {
height: isLetterIdenticon ? 40 : 20 height: isLetterIdenticon ? 40 : 20
@ -71,6 +73,7 @@ Rectangle {
property alias statusListItemTertiaryTitle: statusListItemTertiaryTitle property alias statusListItemTertiaryTitle: statusListItemTertiaryTitle
property alias statusListItemComponentsSlot: statusListItemComponentsSlot property alias statusListItemComponentsSlot: statusListItemComponentsSlot
property alias statusListItemTagsSlot: statusListItemTagsSlot property alias statusListItemTagsSlot: statusListItemTagsSlot
property alias statusListItemInlineTagsSlot: statusListItemTagsSlotInline
signal clicked(string itemId) signal clicked(string itemId)
signal titleClicked(string titleId) signal titleClicked(string titleId)
@ -247,7 +250,19 @@ Rectangle {
width: contentItem.width width: contentItem.width
implicitHeight: visible ? 22 : 0 implicitHeight: visible ? 22 : 0
} }
Row {
id: statusListItemTagsSlotInline
anchors.top: statusListItemTertiaryTitle.bottom
width: parent.width
spacing: 10
clip: true
Repeater {
model: tagsModel
delegate: tagsDelegate
}
}
} }
Row { Row {

View File

@ -48,7 +48,7 @@ Item {
} }
} }
seedSuggestionsList.model = filteredList; seedSuggestionsList.model = filteredList;
if ((text.length === 4) && (filteredList.count === 1) && if ((text.length === 3) && (filteredList.count === 1) &&
((input.edit.keyEvent !== Qt.Key_Backspace) && (input.edit.keyEvent !== Qt.Key_Delete))) { ((input.edit.keyEvent !== Qt.Key_Backspace) && (input.edit.keyEvent !== Qt.Key_Delete))) {
seedWordInput.text = filteredList.get(0).seedWord; seedWordInput.text = filteredList.get(0).seedWord;
seedWordInput.input.edit.cursorPosition = seedWordInput.text.length; seedWordInput.input.edit.cursorPosition = seedWordInput.text.length;