From b266185ce83c81f0c120a9083867817a354107c2 Mon Sep 17 00:00:00 2001 From: Loren Burkholder Date: Tue, 7 Mar 2023 19:10:42 -0500 Subject: Handle incomplete commands better --- resources/qml/MessageInputWarning.qml | 5 +++-- resources/qml/TimelineView.qml | 8 +++++++- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'resources/qml') diff --git a/resources/qml/MessageInputWarning.qml b/resources/qml/MessageInputWarning.qml index af65ebc1..9b0b0907 100644 --- a/resources/qml/MessageInputWarning.qml +++ b/resources/qml/MessageInputWarning.qml @@ -11,6 +11,7 @@ Rectangle { id: warningRoot required property string text + property color bubbleColor: Nheko.theme.error implicitHeight: visible ? warningDisplay.implicitHeight + 4 * Nheko.paddingSmall : 0 height: implicitHeight @@ -22,9 +23,9 @@ Rectangle { visible: warningRoot.visible // TODO: Qt.alpha() would make more sense but it wasn't working... - color: Qt.rgba(Nheko.theme.error.r, Nheko.theme.error.g, Nheko.theme.error.b, 0.3) + color: Qt.rgba(bubbleColor.r, bubbleColor.g, bubbleColor.b, 0.3) border.width: 1 - border.color: Nheko.theme.error + border.color: bubbleColor radius: 3 anchors.fill: parent anchors.margins: visible ? Nheko.paddingSmall : 0 diff --git a/resources/qml/TimelineView.qml b/resources/qml/TimelineView.qml index f0e71c60..abda16b9 100644 --- a/resources/qml/TimelineView.qml +++ b/resources/qml/TimelineView.qml @@ -160,7 +160,13 @@ Item { MessageInputWarning { text: qsTr("The command /%1 is not recognized and will be sent as part of your message").arg(room ? room.input.currentCommand : "") - visible: room ? room.input.containsInvalidCommand : false + visible: room ? room.input.containsInvalidCommand && !room.input.containsIncompleteCommand : false + } + + MessageInputWarning { + text: qsTr("/%1 looks like an incomplete command. To send it anyway, add a space to the end of your message.").arg(room ? room.input.currentCommand : "") + visible: room ? room.input.containsIncompleteCommand : false + bubbleColor: Nheko.theme.orange } ReplyPopup { -- cgit 1.4.1