Fix focus and simplify popup-opener menu items
Introduce a HmenuItemPopupSpawner component that takes care of reacting to onTriggered signals and calling the utils.makePopup() function. The combination of this new component used in HMenu to open a HPopup now correctly takes and restore focus to the right element when closed.
This commit is contained in:
@@ -170,14 +170,13 @@ HColumnLayout {
|
||||
Clipboard.text = selectableLabelContainer.joinedSelection
|
||||
}
|
||||
|
||||
HMenuItem {
|
||||
HMenuItemPopupSpawner {
|
||||
icon.name: "clear-messages"
|
||||
text: qsTr("Clear messages")
|
||||
onTriggered: utils.makePopup(
|
||||
"Popups/ClearMessagesPopup.qml",
|
||||
chat,
|
||||
{userId: chat.userId, roomId: chat.roomId},
|
||||
)
|
||||
|
||||
popup: "Popups/ClearMessagesPopup.qml"
|
||||
popupParent: chat
|
||||
properties: ({userId: chat.userId, roomId: chat.roomId})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user