From 1b30a45eb89288df0d0097d0769941a654892f3f Mon Sep 17 00:00:00 2001 From: Pascal Precht Date: Tue, 15 Jun 2021 17:11:42 +0200 Subject: [PATCH] fix(StatusChatListCategoryItem): don't render menubutton with no popup Fixes #153 --- .../src/StatusQ/Components/StatusChatListCategory.qml | 2 ++ .../src/StatusQ/Components/StatusChatListCategoryItem.qml | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ui/StatusQ/src/StatusQ/Components/StatusChatListCategory.qml b/ui/StatusQ/src/StatusQ/Components/StatusChatListCategory.qml index 632e14695b..a24279ea62 100644 --- a/ui/StatusQ/src/StatusQ/Components/StatusChatListCategory.qml +++ b/ui/StatusQ/src/StatusQ/Components/StatusChatListCategory.qml @@ -31,6 +31,8 @@ Column { title: statusChatListCategory.name opened: statusChatListCategory.opened + showMenuButton: !!statusChatListCategory.popupMenu + onClicked: { if (mouse.button === Qt.RightButton) { highlighted = true diff --git a/ui/StatusQ/src/StatusQ/Components/StatusChatListCategoryItem.qml b/ui/StatusQ/src/StatusQ/Components/StatusChatListCategoryItem.qml index 62d5b46066..237a06c38b 100644 --- a/ui/StatusQ/src/StatusQ/Components/StatusChatListCategoryItem.qml +++ b/ui/StatusQ/src/StatusQ/Components/StatusChatListCategoryItem.qml @@ -17,6 +17,8 @@ StatusListItem { property bool opened: true property bool highlighted: false property bool showActionButtons: false + property bool showMenuButton: showActionButtons + property bool showAddButton: showActionButtons property alias addButton: addButton property alias menuButton: menuButton property alias toggleButton: toggleButton @@ -40,7 +42,7 @@ StatusListItem { id: addButton icon.name: "add" icon.width: 20 - visible: statusChatListCategoryItem.showActionButtons && + visible: statusChatListCategoryItem.showAddButton && (statusChatListCategoryItem.highlighted || statusChatListCategoryItem.sensor.containsMouse) onClicked: statusChatListCategoryItem.addButtonClicked(mouse) @@ -50,7 +52,7 @@ StatusListItem { id: menuButton icon.name: "more" icon.width: 21 - visible: statusChatListCategoryItem.showActionButtons && + visible: statusChatListCategoryItem.showMenuButton && (statusChatListCategoryItem.highlighted || statusChatListCategoryItem.sensor.containsMouse) onClicked: statusChatListCategoryItem.menuButtonClicked(mouse)