chore(StatusItemSelector): allow of using icons (#897)

This commit is contained in:
Michał 2022-09-14 13:03:49 +02:00 committed by GitHub
parent 9a24d59ea8
commit ef5f8746d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 2 deletions

View File

@ -94,6 +94,12 @@ Rectangle {
\endqml
*/
property var itemsModel: ListModel { }
/*!
\qmlproperty bool StatusItemSelector::useIcons
This property determines if the imageSource role from the model will be handled as
an image or an icon.
*/
property bool useIcons: false
/*!
\qmlproperty string StatusItemSelector::andOperatorText
This property holds the string text representation for an `AND` logical operator.
@ -168,7 +174,7 @@ Rectangle {
Layout.fillWidth: true
spacing: 6
StatusListItemTag {
visible: itemsModel.count === 0
visible: !itemsModel || itemsModel.count === 0
title: root.defaultItemText
asset.name: root.defaultItemImageSource
asset.isImage: true
@ -204,7 +210,8 @@ Rectangle {
StatusListItemTag {
title: model.text
asset.name: model.imageSource
asset.isImage: true
asset.isImage: !root.useIcons
asset.bgColor: "transparent"
color: Theme.palette.primaryColor3
closeButtonVisible: false
titleText.color: Theme.palette.primaryColor1