fix(TokenSelector): fix sections and empty search result

- do not display sections with an active search
- display a "No assets found text" when the search yields no results
This commit is contained in:
Lukáš Tinkl 2024-07-02 20:40:27 +02:00 committed by Lukáš Tinkl
parent ca3d1ba067
commit 869abe8b59
1 changed files with 12 additions and 2 deletions

View File

@ -124,7 +124,6 @@ ComboBox {
} }
StatusDialogDivider { StatusDialogDivider {
Layout.fillWidth: true Layout.fillWidth: true
visible: listview.count
} }
StatusListView { StatusListView {
id: listview id: listview
@ -136,7 +135,7 @@ ComboBox {
model: root.popup.visible ? root.delegateModel : null model: root.popup.visible ? root.delegateModel : null
currentIndex: root.highlightedIndex currentIndex: root.highlightedIndex
section.property: "sectionName" section.property: searchBox.text === "" ? "sectionName" : ""
section.delegate: StatusBaseText { section.delegate: StatusBaseText {
required property string section required property string section
width: parent.width width: parent.width
@ -146,6 +145,17 @@ ComboBox {
padding: Style.current.padding padding: Style.current.padding
} }
} }
StatusBaseText {
Layout.fillWidth: true
Layout.preferredHeight: 60
Layout.alignment: Qt.AlignCenter
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
visible: listview.count === 0
color: Theme.palette.baseColor1
text: qsTr("No assets found")
}
} }
background: StatusComboboxBackground { background: StatusComboboxBackground {