mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-17 10:01:44 +00:00
feat(StatusItemSelector): Add possibility to use letter identicons
This commit is contained in:
parent
80b46ce788
commit
4c4abdbea2
@ -100,13 +100,23 @@ Rectangle {
|
|||||||
an image or an icon.
|
an image or an icon.
|
||||||
*/
|
*/
|
||||||
property bool useIcons: false
|
property bool useIcons: false
|
||||||
|
|
||||||
property StatusAssetSettings asset: StatusAssetSettings {
|
property StatusAssetSettings asset: StatusAssetSettings {
|
||||||
height: 20
|
height: 20
|
||||||
width: 20
|
width: 20
|
||||||
bgColor: "transparent"
|
bgColor: "transparent"
|
||||||
isImage: !root.useIcons
|
isImage: !root.useIcons
|
||||||
|
isLetterIdenticon: root.useLetterIdenticons
|
||||||
}
|
}
|
||||||
property int tagLeftPadding: 6
|
property int tagLeftPadding: 6
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\qmlproperty bool StatusItemSelector::useLetterIdenticons
|
||||||
|
This property determines if letter identicons should be used. If set to
|
||||||
|
true, the model is expected to contain roles "color" and "emoji".
|
||||||
|
*/
|
||||||
|
property bool useLetterIdenticons: false
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\qmlsignal StatusItemSelector::itemClicked
|
\qmlsignal StatusItemSelector::itemClicked
|
||||||
This signal is emitted when the item is clicked.
|
This signal is emitted when the item is clicked.
|
||||||
@ -190,15 +200,20 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
StatusListItemTag {
|
StatusListItemTag {
|
||||||
title: model.text
|
title: model.text
|
||||||
asset.name: model.imageSource
|
|
||||||
asset.isImage: root.asset.isImage
|
|
||||||
asset.bgColor: root.asset.bgColor
|
|
||||||
asset.height: root.asset.height
|
asset.height: root.asset.height
|
||||||
asset.width: root.asset.width
|
asset.width: root.asset.width
|
||||||
leftPadding: root.tagLeftPadding
|
asset.name: root.useLetterIdenticons ? model.text : model.imageSource
|
||||||
|
asset.isImage: root.asset.isImage
|
||||||
|
asset.bgColor: root.asset.bgColor
|
||||||
|
asset.emoji: model.emoji ? model.emoji : ""
|
||||||
|
asset.color: model.color ? model.color : ""
|
||||||
|
asset.isLetterIdenticon: root.useLetterIdenticons
|
||||||
|
//color: Theme.palette.primaryColor3
|
||||||
closeButtonVisible: false
|
closeButtonVisible: false
|
||||||
titleText.color: Theme.palette.primaryColor1
|
titleText.color: Theme.palette.primaryColor1
|
||||||
titleText.font.pixelSize: 15
|
titleText.font.pixelSize: 15
|
||||||
|
leftPadding: root.tagLeftPadding
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
Loading…
x
Reference in New Issue
Block a user