Add fancy label if you enter a bad mxid
This commit is contained in:
parent
3c999ade95
commit
4746fcd16f
@ -16,6 +16,10 @@ ApplicationWindow {
|
|||||||
invitees.addUser(inviteeEntry.text);
|
invitees.addUser(inviteeEntry.text);
|
||||||
inviteeEntry.clear();
|
inviteeEntry.clear();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
warningLabel.show()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
title: qsTr("Invite users to ") + roomName
|
title: qsTr("Invite users to ") + roomName
|
||||||
@ -51,6 +55,11 @@ ApplicationWindow {
|
|||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
onAccepted: if (text !== "") addInvite()
|
onAccepted: if (text !== "") addInvite()
|
||||||
Component.onCompleted: forceActiveFocus()
|
Component.onCompleted: forceActiveFocus()
|
||||||
|
|
||||||
|
Shortcut {
|
||||||
|
sequence: "Ctrl+Enter"
|
||||||
|
onActivated: inviteDialogRoot.accept()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
@ -59,6 +68,70 @@ ApplicationWindow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
id: warningLabel
|
||||||
|
|
||||||
|
function show() {
|
||||||
|
state = "shown";
|
||||||
|
warningLabelTimer.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
text: qsTr("Please enter a valid username (e.g. @joe:matrix.org).")
|
||||||
|
color: "red"
|
||||||
|
visible: false
|
||||||
|
opacity: 0
|
||||||
|
state: "hidden"
|
||||||
|
|
||||||
|
states: [
|
||||||
|
State {
|
||||||
|
name: "shown"
|
||||||
|
PropertyChanges {
|
||||||
|
target: warningLabel
|
||||||
|
opacity: 1
|
||||||
|
visible: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
State {
|
||||||
|
name: "hidden"
|
||||||
|
PropertyChanges {
|
||||||
|
target: warningLabel
|
||||||
|
opacity: 0
|
||||||
|
visible: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
transitions: [
|
||||||
|
Transition {
|
||||||
|
from: "shown"
|
||||||
|
to: "hidden"
|
||||||
|
reversible: true
|
||||||
|
|
||||||
|
SequentialAnimation {
|
||||||
|
NumberAnimation {
|
||||||
|
target: warningLabel
|
||||||
|
property: "opacity"
|
||||||
|
duration: 500
|
||||||
|
}
|
||||||
|
|
||||||
|
PropertyAction {
|
||||||
|
target: warningLabel
|
||||||
|
property: "visible"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
id: warningLabelTimer
|
||||||
|
|
||||||
|
interval: 2000
|
||||||
|
repeat: false
|
||||||
|
running: false
|
||||||
|
onTriggered: warningLabel.state = "hidden"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
id: inviteesList
|
id: inviteesList
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user