Color name when highlighting member delegates

This commit is contained in:
miruka 2020-08-21 11:19:42 -04:00
parent 010675001c
commit 044060d1c0
3 changed files with 4 additions and 1 deletions

View File

@ -105,6 +105,7 @@ HListView {
delegate: CompletableUserDelegate { delegate: CompletableUserDelegate {
width: root.width width: root.width
colorName: hovered || root.currentIndex === model.index
onClicked: { onClicked: {
currentIndex = model.index currentIndex = model.index
root.open = false root.open = false

View File

@ -11,6 +11,7 @@ import "../../../../PythonBridge"
HTile { HTile {
id: member id: member
property bool colorName: hovered
property Future getPresenceFuture: null property Future getPresenceFuture: null
backgroundColor: theme.chat.roomPane.listView.member.background backgroundColor: theme.chat.roomPane.listView.member.background
@ -40,7 +41,7 @@ HTile {
TitleLabel { TitleLabel {
text: model.display_name || model.id text: model.display_name || model.id
color: color:
member.hovered ? member.colorName ?
utils.nameColor( utils.nameColor(
model.display_name || model.id.substring(1) model.display_name || model.id.substring(1)
) : ) :

View File

@ -30,6 +30,7 @@ HColumnLayout {
delegate: MemberDelegate { delegate: MemberDelegate {
id: member id: member
width: memberList.width width: memberList.width
colorName: hovered || memberList.currentIndex === model.index
onLeftClicked: stackView.push( onLeftClicked: stackView.push(
"MemberProfile.qml", "MemberProfile.qml",