mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 11:00:48 +03:00
Get Ctrl+Enter working and fix cleaning up and closing
This commit is contained in:
parent
67fff656b3
commit
f1f5796fb8
1 changed files with 14 additions and 15 deletions
|
@ -23,12 +23,24 @@ ApplicationWindow {
|
|||
}
|
||||
}
|
||||
|
||||
function cleanUpAndClose() {
|
||||
if (inviteeEntry.text !== "")
|
||||
addInvite();
|
||||
invitees.accept();
|
||||
close();
|
||||
}
|
||||
|
||||
title: qsTr("Invite users to ") + roomName
|
||||
x: MainWindow.x + (MainWindow.width / 2) - (width / 2)
|
||||
y: MainWindow.y + (MainWindow.height / 2) - (height / 2)
|
||||
height: 380
|
||||
width: 340
|
||||
|
||||
Shortcut {
|
||||
sequence: "Ctrl+Enter"
|
||||
onActivated: cleanUpAndClose()
|
||||
}
|
||||
|
||||
Shortcut {
|
||||
sequence: StandardKey.Cancel
|
||||
onActivated: inviteDialogRoot.close()
|
||||
|
@ -39,10 +51,6 @@ ApplicationWindow {
|
|||
anchors.margins: 10
|
||||
spacing: 10
|
||||
|
||||
Keys.onShortcutOverride: event.accepted = ((event.key === Qt.Key_Return || event.key === Qt.Key_Enter) && (event.modifiers & Qt.ControlModifier))
|
||||
Keys.onEnterPressed: if (event.modifiers & Qt.ControlModifier) invitees.accept()
|
||||
Keys.onReturnPressed: if (event.modifiers & Qt.ControlModifier) invitees.accept()
|
||||
|
||||
Label {
|
||||
text: qsTr("User ID to invite")
|
||||
Layout.fillWidth: true
|
||||
|
@ -64,14 +72,8 @@ ApplicationWindow {
|
|||
}
|
||||
Component.onCompleted: forceActiveFocus()
|
||||
|
||||
// Shortcut {
|
||||
// sequence: "Ctrl+Enter"
|
||||
// onActivated: invitees.accept()
|
||||
// }
|
||||
|
||||
Keys.onShortcutOverride: event.accepted = ((event.key === Qt.Key_Return || event.key === Qt.Key_Enter) && (event.modifiers & Qt.ControlModifier))
|
||||
Keys.onEnterPressed: if (event.modifiers & Qt.ControlModifier) invitees.accept()
|
||||
Keys.onReturnPressed: if (event.modifiers & Qt.ControlModifier) invitees.accept()
|
||||
Keys.onPressed: if ((event.key === Qt.Key_Return || event.key === Qt.Key_Enter) && (event.modifiers === Qt.ControlModifier)) cleanUpAndClose()
|
||||
|
||||
}
|
||||
|
||||
|
@ -208,10 +210,7 @@ ApplicationWindow {
|
|||
Button {
|
||||
text: qsTr("Invite")
|
||||
DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole
|
||||
onClicked: {
|
||||
invitees.accept();
|
||||
inviteDialogRoot.close();
|
||||
}
|
||||
onClicked: cleanUpAndClose()
|
||||
}
|
||||
|
||||
Button {
|
||||
|
|
Loading…
Reference in a new issue