Rename avatar/nameHue funcs to avatar/nameColor

This commit is contained in:
miruka 2019-07-04 16:56:34 -04:00
parent fde7f4aee6
commit 22dfd83d32
3 changed files with 7 additions and 7 deletions

View File

@ -15,7 +15,7 @@ Rectangle {
opacity: hidden ? 0 : 1
color: name ? Utils.avatarHue(name) : HStyle.avatar.background.unknown
color: name ? Utils.avatarColor(name) : HStyle.avatar.background.unknown
HLabel {
z: 1

View File

@ -41,7 +41,7 @@ Row {
id: nameLabel
text: senderInfo.displayName || model.senderId
color: Utils.nameHue(avatar.name)
color: Utils.nameColor(avatar.name)
elide: Text.ElideRight
maximumLineCount: 1
horizontalAlignment: isOwn ? Text.AlignRight : Text.AlignLeft

View File

@ -20,7 +20,7 @@ function hueFrom(string) {
}
function avatarHue(name) { // TODO: bad name
function avatarColor(name) {
return Qt.hsla(
hueFrom(name),
HStyle.avatar.background.saturation,
@ -30,7 +30,7 @@ function avatarHue(name) { // TODO: bad name
}
function nameHue(name) { // TODO: bad name
function nameColor(name) {
return Qt.hsla(
hueFrom(name),
HStyle.displayName.saturation,
@ -41,9 +41,9 @@ function nameHue(name) { // TODO: bad name
function coloredNameHtml(name, alt_id) {
return "<font color='" + nameHue(name || stripUserId(alt_id)) + "'>" +
escapeHtml(name || alt_id) +
"</font>"
return "<font color='" + nameColor(name || stripUserId(alt_id)) + "'>" +
escapeHtml(name || alt_id) +
"</font>"
}