From ad7f39f91c0458a2de84f502d65c68103144fe8e Mon Sep 17 00:00:00 2001 From: Igor Sirotin Date: Thu, 14 Mar 2024 15:46:28 +0000 Subject: [PATCH] fix: category item style (#13975) --- .../src/StatusQ/Components/StatusChatList.qml | 1 + .../Components/StatusChatListCategoryItem.qml | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ui/StatusQ/src/StatusQ/Components/StatusChatList.qml b/ui/StatusQ/src/StatusQ/Components/StatusChatList.qml index 9b08fb5bbc..b069aa11fe 100644 --- a/ui/StatusQ/src/StatusQ/Components/StatusChatList.qml +++ b/ui/StatusQ/src/StatusQ/Components/StatusChatList.qml @@ -139,6 +139,7 @@ Item { showAddButton: showCategoryActionButtons showMenuButton: !!root.popupMenu hasUnreadMessages: model.hasUnreadMessages + muted: model.muted onClicked: { if (mouse.button === Qt.RightButton && showCategoryActionButtons && !!root.categoryPopupMenu) { statusChatListCategoryItem.setupPopup() diff --git a/ui/StatusQ/src/StatusQ/Components/StatusChatListCategoryItem.qml b/ui/StatusQ/src/StatusQ/Components/StatusChatListCategoryItem.qml index 58e2bc8122..dcc5feeec6 100644 --- a/ui/StatusQ/src/StatusQ/Components/StatusChatListCategoryItem.qml +++ b/ui/StatusQ/src/StatusQ/Components/StatusChatListCategoryItem.qml @@ -21,6 +21,7 @@ Control { property bool showMenuButton: showActionButtons property bool showAddButton: showActionButtons property bool hasUnreadMessages: false + property bool muted: false property alias addButton: addButton property alias menuButton: menuButton property alias toggleButton: toggleButton @@ -44,10 +45,19 @@ Control { StatusBaseText { width: Math.min(implicitWidth, parent.width) anchors.verticalCenter: parent.verticalCenter - font.weight: Font.Medium + font.weight: root.hasUnreadMessages ? Font.Bold : Font.Medium font.pixelSize: 15 elide: Text.ElideRight - color: Theme.palette.directColor4 + color: { + if (root.muted && !hoverHandler.hovered && !root.highlighted) { + return Theme.palette.directColor5 + } + if (root.hasUnreadMessages || root.highlighted || hoverHandler.hovered) { + return Theme.palette.directColor1 + } + return Theme.palette.directColor4 + } + text: root.text } Row { @@ -80,3 +90,4 @@ Control { } } } +