From 044060d1c0c190047f5d130a62788e7e36eaf10d Mon Sep 17 00:00:00 2001 From: miruka Date: Fri, 21 Aug 2020 11:19:42 -0400 Subject: [PATCH] Color name when highlighting member delegates --- src/gui/Pages/Chat/AutoCompletion/UserAutoCompletion.qml | 1 + src/gui/Pages/Chat/RoomPane/MemberView/MemberDelegate.qml | 3 ++- src/gui/Pages/Chat/RoomPane/MemberView/MemberView.qml | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/Pages/Chat/AutoCompletion/UserAutoCompletion.qml b/src/gui/Pages/Chat/AutoCompletion/UserAutoCompletion.qml index bff05337..1d1a285f 100644 --- a/src/gui/Pages/Chat/AutoCompletion/UserAutoCompletion.qml +++ b/src/gui/Pages/Chat/AutoCompletion/UserAutoCompletion.qml @@ -105,6 +105,7 @@ HListView { delegate: CompletableUserDelegate { width: root.width + colorName: hovered || root.currentIndex === model.index onClicked: { currentIndex = model.index root.open = false diff --git a/src/gui/Pages/Chat/RoomPane/MemberView/MemberDelegate.qml b/src/gui/Pages/Chat/RoomPane/MemberView/MemberDelegate.qml index e727e5f2..6f86035d 100644 --- a/src/gui/Pages/Chat/RoomPane/MemberView/MemberDelegate.qml +++ b/src/gui/Pages/Chat/RoomPane/MemberView/MemberDelegate.qml @@ -11,6 +11,7 @@ import "../../../../PythonBridge" HTile { id: member + property bool colorName: hovered property Future getPresenceFuture: null backgroundColor: theme.chat.roomPane.listView.member.background @@ -40,7 +41,7 @@ HTile { TitleLabel { text: model.display_name || model.id color: - member.hovered ? + member.colorName ? utils.nameColor( model.display_name || model.id.substring(1) ) : diff --git a/src/gui/Pages/Chat/RoomPane/MemberView/MemberView.qml b/src/gui/Pages/Chat/RoomPane/MemberView/MemberView.qml index c88334af..93a8d402 100644 --- a/src/gui/Pages/Chat/RoomPane/MemberView/MemberView.qml +++ b/src/gui/Pages/Chat/RoomPane/MemberView/MemberView.qml @@ -30,6 +30,7 @@ HColumnLayout { delegate: MemberDelegate { id: member width: memberList.width + colorName: hovered || memberList.currentIndex === model.index onLeftClicked: stackView.push( "MemberProfile.qml",