feat(StatusChatInfoToolBar): make statusMenuButton public

This commit is contained in:
Anthony Laibe 2021-07-16 11:11:31 +02:00 committed by Michał Cieślak
parent 5c74322a50
commit 2b5b56b0fa
1 changed files with 7 additions and 6 deletions

View File

@ -11,6 +11,7 @@ Item {
implicitHeight: 56 implicitHeight: 56
property alias chatInfoButton: statusChatInfoButton property alias chatInfoButton: statusChatInfoButton
property alias menuButton: statusMenuButton
property Component popupMenu property Component popupMenu
signal chatInfoButtonClicked() signal chatInfoButtonClicked()
@ -32,7 +33,7 @@ Item {
} }
StatusRoundButton { StatusRoundButton {
id: menuButton id: statusMenuButton
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: 8 anchors.rightMargin: 8
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
@ -49,14 +50,14 @@ Item {
State { State {
name: "default" name: "default"
PropertyChanges { PropertyChanges {
target: menuButton target: statusMenuButton
icon.rotation: 0 icon.rotation: 0
} }
}, },
State { State {
name: "pressed" name: "pressed"
PropertyChanges { PropertyChanges {
target: menuButton target: statusMenuButton
icon.rotation: 45 icon.rotation: 45
highlighted: true highlighted: true
} }
@ -87,8 +88,8 @@ Item {
onClicked: { onClicked: {
statusChatInfoToolBar.addButtonClicked(mouse) statusChatInfoToolBar.addButtonClicked(mouse)
menuButton.state = "pressed" statusMenuButton.state = "pressed"
popupMenuSlot.item.popup(menuButton.width-popupMenuSlot.item.width, menuButton.height + 4) popupMenuSlot.item.popup(statusMenuButton.width-popupMenuSlot.item.width, statusMenuButton.height + 4)
} }
Loader { Loader {
@ -96,7 +97,7 @@ Item {
active: !!statusChatInfoToolBar.popupMenu active: !!statusChatInfoToolBar.popupMenu
onLoaded: { onLoaded: {
popupMenuSlot.item.closeHandler = function () { popupMenuSlot.item.closeHandler = function () {
menuButton.state = "default" statusMenuButton.state = "default"
} }
} }
} }