fix(StatusChatListCategoryItem): don't render menubutton with no popup

Fixes #153
This commit is contained in:
Pascal Precht 2021-06-15 17:11:42 +02:00 committed by Michał Cieślak
parent 209a208455
commit 1b30a45eb8
2 changed files with 6 additions and 2 deletions

View File

@ -31,6 +31,8 @@ Column {
title: statusChatListCategory.name
opened: statusChatListCategory.opened
showMenuButton: !!statusChatListCategory.popupMenu
onClicked: {
if (mouse.button === Qt.RightButton) {
highlighted = true

View File

@ -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)