diff --git a/sandbox/DemoApp.qml b/sandbox/DemoApp.qml index f0488d21..ed67c219 100644 --- a/sandbox/DemoApp.qml +++ b/sandbox/DemoApp.qml @@ -279,7 +279,7 @@ Rectangle { StatusChatListCategory { name: "Public" - + showActionButtons: true chatList.chatListItems.model: demoCommunityChatListItems chatList.selectedChatId: "0" chatList.onChatItemSelected: chatList.selectedChatId = id @@ -289,6 +289,7 @@ Rectangle { StatusChatListCategory { name: "Development" + showActionButtons: true chatList.chatListItems.model: demoCommunityChatListItems chatList.onChatItemSelected: chatList.selectedChatId = id popupMenu: categoryPopupCmp diff --git a/sandbox/ListItems.qml b/sandbox/ListItems.qml index 6ba94946..fb35851e 100644 --- a/sandbox/ListItems.qml +++ b/sandbox/ListItems.qml @@ -40,11 +40,18 @@ GridLayout { StatusChatListCategoryItem { title: "Chat list category" opened: false + showActionButtons: true } StatusChatListCategoryItem { title: "Chat list category (opened)" opened: true + showActionButtons: true + } + + StatusChatListCategoryItem { + title: "Chat list category (no buttons)" + opened: true } StatusChatListItem { diff --git a/src/StatusQ/Components/StatusChatListCategory.qml b/src/StatusQ/Components/StatusChatListCategory.qml index d31d42fb..4450432a 100644 --- a/src/StatusQ/Components/StatusChatListCategory.qml +++ b/src/StatusQ/Components/StatusChatListCategory.qml @@ -12,6 +12,7 @@ Column { property string name: "" property bool opened: true + property alias showActionButtons: statusChatListCategoryItem.showActionButtons property alias addButton: statusChatListCategoryItem.addButton property alias menuButton: statusChatListCategoryItem.menuButton property alias toggleButton: statusChatListCategoryItem.toggleButton diff --git a/src/StatusQ/Components/StatusChatListCategoryItem.qml b/src/StatusQ/Components/StatusChatListCategoryItem.qml index e410e7dc..62d5b460 100644 --- a/src/StatusQ/Components/StatusChatListCategoryItem.qml +++ b/src/StatusQ/Components/StatusChatListCategoryItem.qml @@ -16,6 +16,7 @@ StatusListItem { property bool opened: true property bool highlighted: false + property bool showActionButtons: false property alias addButton: addButton property alias menuButton: menuButton property alias toggleButton: toggleButton @@ -39,7 +40,9 @@ StatusListItem { id: addButton icon.name: "add" icon.width: 20 - visible: statusChatListCategoryItem.sensor.containsMouse || statusChatListCategoryItem.highlighted + visible: statusChatListCategoryItem.showActionButtons && + (statusChatListCategoryItem.highlighted || + statusChatListCategoryItem.sensor.containsMouse) onClicked: statusChatListCategoryItem.addButtonClicked(mouse) tooltip.text: "Add channel inside category" }, @@ -47,7 +50,9 @@ StatusListItem { id: menuButton icon.name: "more" icon.width: 21 - visible: statusChatListCategoryItem.sensor.containsMouse || statusChatListCategoryItem.highlighted + visible: statusChatListCategoryItem.showActionButtons && + (statusChatListCategoryItem.highlighted || + statusChatListCategoryItem.sensor.containsMouse) onClicked: statusChatListCategoryItem.menuButtonClicked(mouse) tooltip.text: "More" },