Use null coalescing.
This commit is contained in:
@@ -224,7 +224,7 @@ Item {
|
||||
Layout.fillHeight: true
|
||||
|
||||
source: avatar
|
||||
hint: name || "No Name"
|
||||
hint: name ?? ""
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
@@ -236,7 +236,7 @@ Item {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
|
||||
text: name || "No Name"
|
||||
text: name ?? ""
|
||||
color: MPalette.foreground
|
||||
font.pixelSize: 16
|
||||
font.bold: unreadCount >= 0
|
||||
|
||||
@@ -130,9 +130,9 @@ Control {
|
||||
keyNavigationWraps: true
|
||||
|
||||
delegate: Control {
|
||||
property string autoCompleteText: modelData.displayName || modelData.unicode
|
||||
property string autoCompleteText: modelData.displayName ?? modelData.unicode
|
||||
property bool isEmoji: modelData.unicode != null
|
||||
readonly property bool highlighted: autoCompleteListView.currentIndex === index
|
||||
readonly property bool highlighted: autoCompleteListView.currentIndex == index
|
||||
|
||||
height: 36
|
||||
padding: 6
|
||||
@@ -140,7 +140,7 @@ Control {
|
||||
background: Rectangle {
|
||||
visible: !isEmoji
|
||||
color: highlighted ? border.color : "transparent"
|
||||
border.color: isEmoji ? Material.accent : modelData.color
|
||||
border.color: isEmoji ? MPalette.accent : modelData.color
|
||||
border.width: 2
|
||||
radius: height / 2
|
||||
}
|
||||
@@ -164,7 +164,7 @@ Control {
|
||||
Layout.preferredHeight: 24
|
||||
|
||||
visible: !isEmoji
|
||||
source: modelData.avatarMediaId || null
|
||||
source: modelData.avatarMediaId ?? null
|
||||
color: modelData.color ? Qt.darker(modelData.color, 1.1) : MPalette.accent
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user