diff options
Diffstat (limited to 'resources/qml')
-rw-r--r-- | resources/qml/device-verification/DeviceVerification.qml | 36 | ||||
-rw-r--r-- | resources/qml/device-verification/DigitVerification.qml | 91 | ||||
-rw-r--r-- | resources/qml/device-verification/EmojiVerification.qml | 759 | ||||
-rw-r--r-- | resources/qml/device-verification/Failed.qml | 62 | ||||
-rw-r--r-- | resources/qml/device-verification/NewVerificationRequest.qml | 89 | ||||
-rw-r--r-- | resources/qml/device-verification/Success.qml | 47 | ||||
-rw-r--r-- | resources/qml/device-verification/Waiting.qml | 69 |
7 files changed, 560 insertions, 593 deletions
diff --git a/resources/qml/device-verification/DeviceVerification.qml b/resources/qml/device-verification/DeviceVerification.qml index 90dc9ac4..ead293d2 100644 --- a/resources/qml/device-verification/DeviceVerification.qml +++ b/resources/qml/device-verification/DeviceVerification.qml @@ -14,21 +14,29 @@ ApplicationWindow { property var flow onClosing: VerificationManager.removeVerificationFlow(flow) - title: stack.currentItem.title_ + title: stack.currentItem ? (stack.currentItem.title_ || "") : "" modality: Qt.NonModal palette: Nheko.colors color: Nheko.colors.window - minimumHeight: stack.implicitHeight - width: stack.implicitWidth + //height: stack.currentItem.implicitHeight + minimumHeight: stack.currentItem.implicitHeight + 2 * Nheko.paddingLarge + height: stack.currentItem.implicitHeight + 2 * Nheko.paddingMedium + minimumWidth: 400 flags: Qt.Dialog | Qt.WindowCloseButtonHint | Qt.WindowTitleHint + background: Rectangle { + color: Nheko.colors.window + } + + StackView { id: stack - anchors.fill: parent + anchors.centerIn: parent + initialItem: newVerificationRequest - implicitWidth: currentItem.implicitWidth - implicitHeight: currentItem.implicitHeight + implicitWidth: dialog.width - 2* Nheko.paddingMedium + implicitHeight: dialog.height - 2* Nheko.paddingMedium } Component { @@ -86,7 +94,7 @@ ApplicationWindow { name: "PromptStartVerification" StateChangeScript { - script: stack.replace(newVerificationRequest) + script: stack.replace(null, newVerificationRequest) } }, @@ -94,7 +102,7 @@ ApplicationWindow { name: "CompareEmoji" StateChangeScript { - script: stack.replace(emojiVerification) + script: stack.replace(null, emojiVerification) } }, @@ -102,7 +110,7 @@ ApplicationWindow { name: "CompareNumber" StateChangeScript { - script: stack.replace(digitVerification) + script: stack.replace(null, digitVerification) } }, @@ -110,7 +118,7 @@ ApplicationWindow { name: "WaitingForKeys" StateChangeScript { - script: stack.replace(waiting) + script: stack.replace(null, waiting) } }, @@ -118,7 +126,7 @@ ApplicationWindow { name: "WaitingForOtherToAccept" StateChangeScript { - script: stack.replace(waiting) + script: stack.replace(null, waiting) } }, @@ -126,7 +134,7 @@ ApplicationWindow { name: "WaitingForMac" StateChangeScript { - script: stack.replace(waiting) + script: stack.replace(null, waiting) } }, @@ -134,7 +142,7 @@ ApplicationWindow { name: "Success" StateChangeScript { - script: stack.replace(success) + script: stack.replace(null, success) } }, @@ -142,7 +150,7 @@ ApplicationWindow { name: "Failed" StateChangeScript { - script: stack.replace(failed) + script: stack.replace(null, failed) } } diff --git a/resources/qml/device-verification/DigitVerification.qml b/resources/qml/device-verification/DigitVerification.qml index 3a8b0df5..e1f8f6cf 100644 --- a/resources/qml/device-verification/DigitVerification.qml +++ b/resources/qml/device-verification/DigitVerification.qml @@ -8,70 +8,63 @@ import QtQuick.Controls 2.3 import QtQuick.Layouts 1.10 import im.nheko 1.0 -Pane { +ColumnLayout { property string title: qsTr("Verification Code") - background: Rectangle { - color: Nheko.colors.window + + spacing: 16 + + Label { + Layout.preferredWidth: 400 + Layout.fillWidth: true + wrapMode: Text.Wrap + text: qsTr("Please verify the following digits. You should see the same numbers on both sides. If they differ, please press 'They do not match!' to abort verification!") + color: Nheko.colors.text + verticalAlignment: Text.AlignVCenter } - ColumnLayout { - anchors.fill: parent - spacing: 16 + Item { Layout.fillHeight: true; } + RowLayout { + Layout.alignment: Qt.AlignHCenter Label { - Layout.preferredWidth: 400 - Layout.fillWidth: true - wrapMode: Text.Wrap - text: qsTr("Please verify the following digits. You should see the same numbers on both sides. If they differ, please press 'They do not match!' to abort verification!") + font.pixelSize: Qt.application.font.pixelSize * 2 + text: flow.sasList[0] color: Nheko.colors.text - verticalAlignment: Text.AlignVCenter } - Item { Layout.fillHeight: true; } - RowLayout { - Layout.alignment: Qt.AlignHCenter - - Label { - font.pixelSize: Qt.application.font.pixelSize * 2 - text: flow.sasList[0] - color: Nheko.colors.text - } - - Label { - font.pixelSize: Qt.application.font.pixelSize * 2 - text: flow.sasList[1] - color: Nheko.colors.text - } - - Label { - font.pixelSize: Qt.application.font.pixelSize * 2 - text: flow.sasList[2] - color: Nheko.colors.text - } + Label { + font.pixelSize: Qt.application.font.pixelSize * 2 + text: flow.sasList[1] + color: Nheko.colors.text + } + Label { + font.pixelSize: Qt.application.font.pixelSize * 2 + text: flow.sasList[2] + color: Nheko.colors.text } - Item { Layout.fillHeight: true; } - RowLayout { - Button { - Layout.alignment: Qt.AlignLeft - text: qsTr("They do not match!") - onClicked: { - flow.cancel(); - dialog.close(); - } - } + } + Item { Layout.fillHeight: true; } - Item { - Layout.fillWidth: true + RowLayout { + Button { + Layout.alignment: Qt.AlignLeft + text: qsTr("They do not match!") + onClicked: { + flow.cancel(); + dialog.close(); } + } - Button { - Layout.alignment: Qt.AlignRight - text: qsTr("They match!") - onClicked: flow.next() - } + Item { + Layout.fillWidth: true + } + Button { + Layout.alignment: Qt.AlignRight + text: qsTr("They match!") + onClicked: flow.next() } } diff --git a/resources/qml/device-verification/EmojiVerification.qml b/resources/qml/device-verification/EmojiVerification.qml index 4c5bfb1a..e97a18a2 100644 --- a/resources/qml/device-verification/EmojiVerification.qml +++ b/resources/qml/device-verification/EmojiVerification.qml @@ -8,386 +8,379 @@ import QtQuick.Controls 2.3 import QtQuick.Layouts 1.10 import im.nheko 1.0 -Pane { +ColumnLayout { property string title: qsTr("Verification Code") - background: Rectangle { - color: Nheko.colors.window - } - - ColumnLayout { - anchors.fill: parent - spacing: 16 - Label { - Layout.preferredWidth: 400 - Layout.fillWidth: true - wrapMode: Text.Wrap - text: qsTr("Please verify the following emoji. You should see the same emoji on both sides. If they differ, please press 'They do not match!' to abort verification!") - color: Nheko.colors.text - verticalAlignment: Text.AlignVCenter - } + spacing: 16 - Item { Layout.fillHeight: true; } - RowLayout { - id: emojis + Label { + Layout.preferredWidth: 400 + Layout.fillWidth: true + wrapMode: Text.Wrap + text: qsTr("Please verify the following emoji. You should see the same emoji on both sides. If they differ, please press 'They do not match!' to abort verification!") + color: Nheko.colors.text + verticalAlignment: Text.AlignVCenter + } - property var mapping: [{ - "number": 0, - "emoji": "πΆ", - "description": "Dog", - "unicode": "U+1F436" - }, { - "number": 1, - "emoji": "π±", - "description": "Cat", - "unicode": "U+1F431" - }, { - "number": 2, - "emoji": "π¦", - "description": "Lion", - "unicode": "U+1F981" - }, { - "number": 3, - "emoji": "π", - "description": "Horse", - "unicode": "U+1F40E" - }, { - "number": 4, - "emoji": "π¦", - "description": "Unicorn", - "unicode": "U+1F984" - }, { - "number": 5, - "emoji": "π·", - "description": "Pig", - "unicode": "U+1F437" - }, { - "number": 6, - "emoji": "π", - "description": "Elephant", - "unicode": "U+1F418" - }, { - "number": 7, - "emoji": "π°", - "description": "Rabbit", - "unicode": "U+1F430" - }, { - "number": 8, - "emoji": "πΌ", - "description": "Panda", - "unicode": "U+1F43C" - }, { - "number": 9, - "emoji": "π", - "description": "Rooster", - "unicode": "U+1F413" - }, { - "number": 10, - "emoji": "π§", - "description": "Penguin", - "unicode": "U+1F427" - }, { - "number": 11, - "emoji": "π’", - "description": "Turtle", - "unicode": "U+1F422" - }, { - "number": 12, - "emoji": "π", - "description": "Fish", - "unicode": "U+1F41F" - }, { - "number": 13, - "emoji": "π", - "description": "Octopus", - "unicode": "U+1F419" - }, { - "number": 14, - "emoji": "π¦", - "description": "Butterfly", - "unicode": "U+1F98B" - }, { - "number": 15, - "emoji": "π·", - "description": "Flower", - "unicode": "U+1F337" - }, { - "number": 16, - "emoji": "π³", - "description": "Tree", - "unicode": "U+1F333" - }, { - "number": 17, - "emoji": "π΅", - "description": "Cactus", - "unicode": "U+1F335" - }, { - "number": 18, - "emoji": "π", - "description": "Mushroom", - "unicode": "U+1F344" - }, { - "number": 19, - "emoji": "π", - "description": "Globe", - "unicode": "U+1F30F" - }, { - "number": 20, - "emoji": "π", - "description": "Moon", - "unicode": "U+1F319" - }, { - "number": 21, - "emoji": "βοΈ", - "description": "Cloud", - "unicode": "U+2601U+FE0F" - }, { - "number": 22, - "emoji": "π₯", - "description": "Fire", - "unicode": "U+1F525" - }, { - "number": 23, - "emoji": "π", - "description": "Banana", - "unicode": "U+1F34C" - }, { - "number": 24, - "emoji": "π", - "description": "Apple", - "unicode": "U+1F34E" - }, { - "number": 25, - "emoji": "π", - "description": "Strawberry", - "unicode": "U+1F353" - }, { - "number": 26, - "emoji": "π½", - "description": "Corn", - "unicode": "U+1F33D" - }, { - "number": 27, - "emoji": "π", - "description": "Pizza", - "unicode": "U+1F355" - }, { - "number": 28, - "emoji": "π", - "description": "Cake", - "unicode": "U+1F382" - }, { - "number": 29, - "emoji": "β€οΈ", - "description": "Heart", - "unicode": "U+2764U+FE0F" - }, { - "number": 30, - "emoji": "π", - "description": "Smiley", - "unicode": "U+1F600" - }, { - "number": 31, - "emoji": "π€", - "description": "Robot", - "unicode": "U+1F916" - }, { - "number": 32, - "emoji": "π©", - "description": "Hat", - "unicode": "U+1F3A9" - }, { - "number": 33, - "emoji": "π", - "description": "Glasses", - "unicode": "U+1F453" - }, { - "number": 34, - "emoji": "π§", - "description": "Spanner", - "unicode": "U+1F527" - }, { - "number": 35, - "emoji": "π ", - "description": "Santa", - "unicode": "U+1F385" - }, { - "number": 36, - "emoji": "π", - "description": "Thumbs Up", - "unicode": "U+1F44D" - }, { - "number": 37, - "emoji": "βοΈ", - "description": "Umbrella", - "unicode": "U+2602U+FE0F" - }, { - "number": 38, - "emoji": "β", - "description": "Hourglass", - "unicode": "U+231B" - }, { - "number": 39, - "emoji": "β°", - "description": "Clock", - "unicode": "U+23F0" - }, { - "number": 40, - "emoji": "π", - "description": "Gift", - "unicode": "U+1F381" - }, { - "number": 41, - "emoji": "π‘", - "description": "Light Bulb", - "unicode": "U+1F4A1" - }, { - "number": 42, - "emoji": "π", - "description": "Book", - "unicode": "U+1F4D5" - }, { - "number": 43, - "emoji": "βοΈ", - "description": "Pencil", - "unicode": "U+270FU+FE0F" - }, { - "number": 44, - "emoji": "π", - "description": "Paperclip", - "unicode": "U+1F4CE" - }, { - "number": 45, - "emoji": "βοΈ", - "description": "Scissors", - "unicode": "U+2702U+FE0F" - }, { - "number": 46, - "emoji": "π", - "description": "Lock", - "unicode": "U+1F512" - }, { - "number": 47, - "emoji": "π", - "description": "Key", - "unicode": "U+1F511" - }, { - "number": 48, - "emoji": "π¨", - "description": "Hammer", - "unicode": "U+1F528" - }, { - "number": 49, - "emoji": "βοΈ", - "description": "Telephone", - "unicode": "U+260EU+FE0F" - }, { - "number": 50, - "emoji": "π", - "description": "Flag", - "unicode": "U+1F3C1" - }, { - "number": 51, - "emoji": "π", - "description": "Train", - "unicode": "U+1F682" - }, { - "number": 52, - "emoji": "π²", - "description": "Bicycle", - "unicode": "U+1F6B2" - }, { - "number": 53, - "emoji": "βοΈ", - "description": "Aeroplane", - "unicode": "U+2708U+FE0F" - }, { - "number": 54, - "emoji": "π", - "description": "Rocket", - "unicode": "U+1F680" - }, { - "number": 55, - "emoji": "π", - "description": "Trophy", - "unicode": "U+1F3C6" - }, { - "number": 56, - "emoji": "β½", - "description": "Ball", - "unicode": "U+26BD" - }, { - "number": 57, - "emoji": "πΈ", - "description": "Guitar", - "unicode": "U+1F3B8" - }, { - "number": 58, - "emoji": "πΊ", - "description": "Trumpet", - "unicode": "U+1F3BA" - }, { - "number": 59, - "emoji": "π", - "description": "Bell", - "unicode": "U+1F514" - }, { - "number": 60, - "emoji": "β", - "description": "Anchor", - "unicode": "U+2693" - }, { - "number": 61, - "emoji": "π§", - "description": "Headphones", - "unicode": "U+1F3A7" - }, { - "number": 62, - "emoji": "π", - "description": "Folder", - "unicode": "U+1F4C1" - }, { - "number": 63, - "emoji": "π", - "description": "Pin", - "unicode": "U+1F4CC" - }] + Item { Layout.fillHeight: true; } + RowLayout { + id: emojis - Layout.alignment: Qt.AlignHCenter + property var mapping: [{ + "number": 0, + "emoji": "πΆ", + "description": "Dog", + "unicode": "U+1F436" + }, { + "number": 1, + "emoji": "π±", + "description": "Cat", + "unicode": "U+1F431" + }, { + "number": 2, + "emoji": "π¦", + "description": "Lion", + "unicode": "U+1F981" + }, { + "number": 3, + "emoji": "π", + "description": "Horse", + "unicode": "U+1F40E" + }, { + "number": 4, + "emoji": "π¦", + "description": "Unicorn", + "unicode": "U+1F984" + }, { + "number": 5, + "emoji": "π·", + "description": "Pig", + "unicode": "U+1F437" + }, { + "number": 6, + "emoji": "π", + "description": "Elephant", + "unicode": "U+1F418" + }, { + "number": 7, + "emoji": "π°", + "description": "Rabbit", + "unicode": "U+1F430" + }, { + "number": 8, + "emoji": "πΌ", + "description": "Panda", + "unicode": "U+1F43C" + }, { + "number": 9, + "emoji": "π", + "description": "Rooster", + "unicode": "U+1F413" + }, { + "number": 10, + "emoji": "π§", + "description": "Penguin", + "unicode": "U+1F427" + }, { + "number": 11, + "emoji": "π’", + "description": "Turtle", + "unicode": "U+1F422" + }, { + "number": 12, + "emoji": "π", + "description": "Fish", + "unicode": "U+1F41F" + }, { + "number": 13, + "emoji": "π", + "description": "Octopus", + "unicode": "U+1F419" + }, { + "number": 14, + "emoji": "π¦", + "description": "Butterfly", + "unicode": "U+1F98B" + }, { + "number": 15, + "emoji": "π·", + "description": "Flower", + "unicode": "U+1F337" + }, { + "number": 16, + "emoji": "π³", + "description": "Tree", + "unicode": "U+1F333" + }, { + "number": 17, + "emoji": "π΅", + "description": "Cactus", + "unicode": "U+1F335" + }, { + "number": 18, + "emoji": "π", + "description": "Mushroom", + "unicode": "U+1F344" + }, { + "number": 19, + "emoji": "π", + "description": "Globe", + "unicode": "U+1F30F" + }, { + "number": 20, + "emoji": "π", + "description": "Moon", + "unicode": "U+1F319" + }, { + "number": 21, + "emoji": "βοΈ", + "description": "Cloud", + "unicode": "U+2601U+FE0F" + }, { + "number": 22, + "emoji": "π₯", + "description": "Fire", + "unicode": "U+1F525" + }, { + "number": 23, + "emoji": "π", + "description": "Banana", + "unicode": "U+1F34C" + }, { + "number": 24, + "emoji": "π", + "description": "Apple", + "unicode": "U+1F34E" + }, { + "number": 25, + "emoji": "π", + "description": "Strawberry", + "unicode": "U+1F353" + }, { + "number": 26, + "emoji": "π½", + "description": "Corn", + "unicode": "U+1F33D" + }, { + "number": 27, + "emoji": "π", + "description": "Pizza", + "unicode": "U+1F355" + }, { + "number": 28, + "emoji": "π", + "description": "Cake", + "unicode": "U+1F382" + }, { + "number": 29, + "emoji": "β€οΈ", + "description": "Heart", + "unicode": "U+2764U+FE0F" + }, { + "number": 30, + "emoji": "π", + "description": "Smiley", + "unicode": "U+1F600" + }, { + "number": 31, + "emoji": "π€", + "description": "Robot", + "unicode": "U+1F916" + }, { + "number": 32, + "emoji": "π©", + "description": "Hat", + "unicode": "U+1F3A9" + }, { + "number": 33, + "emoji": "π", + "description": "Glasses", + "unicode": "U+1F453" + }, { + "number": 34, + "emoji": "π§", + "description": "Spanner", + "unicode": "U+1F527" + }, { + "number": 35, + "emoji": "π ", + "description": "Santa", + "unicode": "U+1F385" + }, { + "number": 36, + "emoji": "π", + "description": "Thumbs Up", + "unicode": "U+1F44D" + }, { + "number": 37, + "emoji": "βοΈ", + "description": "Umbrella", + "unicode": "U+2602U+FE0F" + }, { + "number": 38, + "emoji": "β", + "description": "Hourglass", + "unicode": "U+231B" + }, { + "number": 39, + "emoji": "β°", + "description": "Clock", + "unicode": "U+23F0" + }, { + "number": 40, + "emoji": "π", + "description": "Gift", + "unicode": "U+1F381" + }, { + "number": 41, + "emoji": "π‘", + "description": "Light Bulb", + "unicode": "U+1F4A1" + }, { + "number": 42, + "emoji": "π", + "description": "Book", + "unicode": "U+1F4D5" + }, { + "number": 43, + "emoji": "βοΈ", + "description": "Pencil", + "unicode": "U+270FU+FE0F" + }, { + "number": 44, + "emoji": "π", + "description": "Paperclip", + "unicode": "U+1F4CE" + }, { + "number": 45, + "emoji": "βοΈ", + "description": "Scissors", + "unicode": "U+2702U+FE0F" + }, { + "number": 46, + "emoji": "π", + "description": "Lock", + "unicode": "U+1F512" + }, { + "number": 47, + "emoji": "π", + "description": "Key", + "unicode": "U+1F511" + }, { + "number": 48, + "emoji": "π¨", + "description": "Hammer", + "unicode": "U+1F528" + }, { + "number": 49, + "emoji": "βοΈ", + "description": "Telephone", + "unicode": "U+260EU+FE0F" + }, { + "number": 50, + "emoji": "π", + "description": "Flag", + "unicode": "U+1F3C1" + }, { + "number": 51, + "emoji": "π", + "description": "Train", + "unicode": "U+1F682" + }, { + "number": 52, + "emoji": "π²", + "description": "Bicycle", + "unicode": "U+1F6B2" + }, { + "number": 53, + "emoji": "βοΈ", + "description": "Aeroplane", + "unicode": "U+2708U+FE0F" + }, { + "number": 54, + "emoji": "π", + "description": "Rocket", + "unicode": "U+1F680" + }, { + "number": 55, + "emoji": "π", + "description": "Trophy", + "unicode": "U+1F3C6" + }, { + "number": 56, + "emoji": "β½", + "description": "Ball", + "unicode": "U+26BD" + }, { + "number": 57, + "emoji": "πΈ", + "description": "Guitar", + "unicode": "U+1F3B8" + }, { + "number": 58, + "emoji": "πΊ", + "description": "Trumpet", + "unicode": "U+1F3BA" + }, { + "number": 59, + "emoji": "π", + "description": "Bell", + "unicode": "U+1F514" + }, { + "number": 60, + "emoji": "β", + "description": "Anchor", + "unicode": "U+2693" + }, { + "number": 61, + "emoji": "π§", + "description": "Headphones", + "unicode": "U+1F3A7" + }, { + "number": 62, + "emoji": "π", + "description": "Folder", + "unicode": "U+1F4C1" + }, { + "number": 63, + "emoji": "π", + "description": "Pin", + "unicode": "U+1F4CC" + }] - Repeater { - id: repeater + Layout.alignment: Qt.AlignHCenter - model: 7 + Repeater { + id: repeater - delegate: Rectangle { - color: "transparent" - implicitHeight: Qt.application.font.pixelSize * 8 - implicitWidth: col.width + model: 7 - ColumnLayout { - id: col + delegate: Rectangle { + color: "transparent" + implicitHeight: Qt.application.font.pixelSize * 8 + implicitWidth: col.width - property var emoji: emojis.mapping[flow.sasList[index]] + ColumnLayout { + id: col - Layout.fillWidth: true - anchors.bottom: parent.bottom + property var emoji: emojis.mapping[flow.sasList[index]] - Label { - //height: font.pixelSize * 2 - Layout.alignment: Qt.AlignHCenter - text: col.emoji.emoji - font.pixelSize: Qt.application.font.pixelSize * 2 - font.family: Settings.emojiFont - color: Nheko.colors.text - } + Layout.fillWidth: true + anchors.bottom: parent.bottom - Label { - Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom - text: col.emoji.description - color: Nheko.colors.text - } + Label { + //height: font.pixelSize * 2 + Layout.alignment: Qt.AlignHCenter + text: col.emoji.emoji + font.pixelSize: Qt.application.font.pixelSize * 2 + font.family: Settings.emojiFont + color: Nheko.colors.text + } + Label { + Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom + text: col.emoji.description + color: Nheko.colors.text } } @@ -395,28 +388,28 @@ Pane { } } - Item { Layout.fillHeight: true; } - RowLayout { - Button { - Layout.alignment: Qt.AlignLeft - text: qsTr("They do not match!") - onClicked: { - flow.cancel(); - dialog.close(); - } - } + } + Item { Layout.fillHeight: true; } - Item { - Layout.fillWidth: true + RowLayout { + Button { + Layout.alignment: Qt.AlignLeft + text: qsTr("They do not match!") + onClicked: { + flow.cancel(); + dialog.close(); } + } - Button { - Layout.alignment: Qt.AlignRight - text: qsTr("They match!") - onClicked: flow.next() - } + Item { + Layout.fillWidth: true + } + Button { + Layout.alignment: Qt.AlignRight + text: qsTr("They match!") + onClicked: flow.next() } } diff --git a/resources/qml/device-verification/Failed.qml b/resources/qml/device-verification/Failed.qml index d070b5a6..77327a75 100644 --- a/resources/qml/device-verification/Failed.qml +++ b/resources/qml/device-verification/Failed.qml @@ -8,57 +8,49 @@ import QtQuick.Controls 2.3 import QtQuick.Layouts 1.10 import im.nheko 1.0 -Pane { +ColumnLayout { property string title: qsTr("Verification failed") - background: Rectangle { - color: Nheko.colors.window - } - - ColumnLayout { - anchors.fill: parent - spacing: 16 + spacing: 16 - Text { - id: content + Text { + id: content - Layout.preferredWidth: 400 - Layout.fillWidth: true - wrapMode: Text.Wrap - text: { - switch (flow.error) { + Layout.preferredWidth: 400 + Layout.fillWidth: true + wrapMode: Text.Wrap + text: { + switch (flow.error) { case DeviceVerificationFlow.UnknownMethod: - return qsTr("Other client does not support our verification protocol."); + return qsTr("Other client does not support our verification protocol."); case DeviceVerificationFlow.MismatchedCommitment: case DeviceVerificationFlow.MismatchedSAS: case DeviceVerificationFlow.KeyMismatch: - return qsTr("Key mismatch detected!"); + return qsTr("Key mismatch detected!"); case DeviceVerificationFlow.Timeout: - return qsTr("Device verification timed out."); + return qsTr("Device verification timed out."); case DeviceVerificationFlow.User: - return qsTr("Other party canceled the verification."); + return qsTr("Other party canceled the verification."); case DeviceVerificationFlow.OutOfOrder: - return qsTr("Verification messages received out of order!"); + return qsTr("Verification messages received out of order!"); default: - return qsTr("Unknown verification error."); - } + return qsTr("Unknown verification error."); } - color: Nheko.colors.text - verticalAlignment: Text.AlignVCenter } + color: Nheko.colors.text + verticalAlignment: Text.AlignVCenter + } - Item { Layout.fillHeight: true; } + Item { Layout.fillHeight: true; } - RowLayout { - Item { - Layout.fillWidth: true - } - - Button { - Layout.alignment: Qt.AlignRight - text: qsTr("Close") - onClicked: dialog.close() - } + RowLayout { + Item { + Layout.fillWidth: true + } + Button { + Layout.alignment: Qt.AlignRight + text: qsTr("Close") + onClicked: dialog.close() } } diff --git a/resources/qml/device-verification/NewVerificationRequest.qml b/resources/qml/device-verification/NewVerificationRequest.qml index b7ed9586..3367f181 100644 --- a/resources/qml/device-verification/NewVerificationRequest.qml +++ b/resources/qml/device-verification/NewVerificationRequest.qml @@ -8,66 +8,59 @@ import QtQuick.Controls 2.3 import QtQuick.Layouts 1.10 import im.nheko 1.0 -Pane { +ColumnLayout { property string title: flow.sender ? qsTr("Send Verification Request") : qsTr("Received Verification Request") - background: Rectangle { - color: Nheko.colors.window - } - ColumnLayout { - anchors.fill: parent - spacing: 16 + spacing: 16 - Label { - // Self verification + Label { + // Self verification - Layout.preferredWidth: 400 - Layout.fillWidth: true - wrapMode: Text.Wrap - text: { - if (flow.sender) { - if (flow.isSelfVerification) - if (flow.isMultiDeviceVerification) - return qsTr("To allow other users to see, which of your devices actually belong to you, you can verify them. This also allows key backup to work automatically. Verify an unverified device now? (Please make sure you have one of those devices available.)"); - else - return qsTr("To allow other users to see, which of your devices actually belong to you, you can verify them. This also allows key backup to work automatically. Verify %1 now?").arg(flow.deviceId); - else - return qsTr("To ensure that no malicious user can eavesdrop on your encrypted communications you can verify the other party."); - } else { - if (!flow.isSelfVerification && flow.isDeviceVerification) - return qsTr("%1 has requested to verify their device %2.").arg(flow.userId).arg(flow.deviceId); - else if (!flow.isSelfVerification && !flow.isDeviceVerification) - return qsTr("%1 using the device %2 has requested to be verified.").arg(flow.userId).arg(flow.deviceId); + Layout.preferredWidth: 400 + Layout.fillWidth: true + wrapMode: Text.Wrap + text: { + if (flow.sender) { + if (flow.isSelfVerification) + if (flow.isMultiDeviceVerification) + return qsTr("To allow other users to see, which of your devices actually belong to you, you can verify them. This also allows key backup to work automatically. Verify an unverified device now? (Please make sure you have one of those devices available.)"); else - return qsTr("Your device (%1) has requested to be verified.").arg(flow.deviceId); - } + return qsTr("To allow other users to see, which of your devices actually belong to you, you can verify them. This also allows key backup to work automatically. Verify %1 now?").arg(flow.deviceId); + else + return qsTr("To ensure that no malicious user can eavesdrop on your encrypted communications you can verify the other party."); + } else { + if (!flow.isSelfVerification && flow.isDeviceVerification) + return qsTr("%1 has requested to verify their device %2.").arg(flow.userId).arg(flow.deviceId); + else if (!flow.isSelfVerification && !flow.isDeviceVerification) + return qsTr("%1 using the device %2 has requested to be verified.").arg(flow.userId).arg(flow.deviceId); + else + return qsTr("Your device (%1) has requested to be verified.").arg(flow.deviceId); } - color: Nheko.colors.text - verticalAlignment: Text.AlignVCenter } + color: Nheko.colors.text + verticalAlignment: Text.AlignVCenter + } - Item { Layout.fillHeight: true; } - - RowLayout { - Button { - Layout.alignment: Qt.AlignLeft - text: flow.sender ? qsTr("Cancel") : qsTr("Deny") - onClicked: { - flow.cancel(); - dialog.close(); - } - } + Item { Layout.fillHeight: true; } - Item { - Layout.fillWidth: true + RowLayout { + Button { + Layout.alignment: Qt.AlignLeft + text: flow.sender ? qsTr("Cancel") : qsTr("Deny") + onClicked: { + flow.cancel(); + dialog.close(); } + } - Button { - Layout.alignment: Qt.AlignRight - text: flow.sender ? qsTr("Start verification") : qsTr("Accept") - onClicked: flow.next() - } + Item { + Layout.fillWidth: true + } + Button { + Layout.alignment: Qt.AlignRight + text: flow.sender ? qsTr("Start verification") : qsTr("Accept") + onClicked: flow.next() } } diff --git a/resources/qml/device-verification/Success.qml b/resources/qml/device-verification/Success.qml index 8d7c8419..d9365194 100644 --- a/resources/qml/device-verification/Success.qml +++ b/resources/qml/device-verification/Success.qml @@ -8,40 +8,33 @@ import QtQuick.Controls 2.3 import QtQuick.Layouts 1.10 import im.nheko 1.0 -Pane { +ColumnLayout { property string title: qsTr("Successful Verification") - background: Rectangle { - color: Nheko.colors.window - } - - ColumnLayout { - anchors.fill: parent - spacing: 16 - Label { - id: content + spacing: 16 - Layout.preferredWidth: 400 - Layout.fillWidth: true - wrapMode: Text.Wrap - text: qsTr("Verification successful! Both sides verified their devices!") - color: Nheko.colors.text - verticalAlignment: Text.AlignVCenter - } + Label { + id: content - Item { Layout.fillHeight: true; } + Layout.preferredWidth: 400 + Layout.fillWidth: true + wrapMode: Text.Wrap + text: qsTr("Verification successful! Both sides verified their devices!") + color: Nheko.colors.text + verticalAlignment: Text.AlignVCenter + } - RowLayout { - Item { - Layout.fillWidth: true - } + Item { Layout.fillHeight: true; } - Button { - Layout.alignment: Qt.AlignRight - text: qsTr("Close") - onClicked: dialog.close() - } + RowLayout { + Item { + Layout.fillWidth: true + } + Button { + Layout.alignment: Qt.AlignRight + text: qsTr("Close") + onClicked: dialog.close() } } diff --git a/resources/qml/device-verification/Waiting.qml b/resources/qml/device-verification/Waiting.qml index e75a97ce..3054b9c3 100644 --- a/resources/qml/device-verification/Waiting.qml +++ b/resources/qml/device-verification/Waiting.qml @@ -9,59 +9,54 @@ import QtQuick.Controls 2.3 import QtQuick.Layouts 1.10 import im.nheko 1.0 -Pane { +ColumnLayout { property string title: qsTr("Waiting for other partyβ¦") - background: Rectangle { - color: Nheko.colors.window - } - - ColumnLayout { - anchors.fill: parent - spacing: 16 + spacing: 16 - Label { - id: content + Label { + id: content - Layout.preferredWidth: 400 - Layout.fillWidth: true - wrapMode: Text.Wrap - text: { - switch (flow.state) { + Layout.preferredWidth: 400 + Layout.fillWidth: true + wrapMode: Text.Wrap + text: { + switch (flow.state) { case "WaitingForOtherToAccept": return qsTr("Waiting for other side to accept the verification request."); case "WaitingForKeys": return qsTr("Waiting for other side to continue the verification process."); case "WaitingForMac": return qsTr("Waiting for other side to complete the verification process."); - } + default: + return ""; } - color: Nheko.colors.text - verticalAlignment: Text.AlignVCenter } + color: Nheko.colors.text + verticalAlignment: Text.AlignVCenter + } - Item { Layout.fillHeight: true; } - Spinner { - Layout.alignment: Qt.AlignHCenter - foreground: Nheko.colors.mid - } - Item { Layout.fillHeight: true; } - - RowLayout { - Button { - Layout.alignment: Qt.AlignLeft - text: qsTr("Cancel") - onClicked: { - flow.cancel(); - dialog.close(); - } - } - - Item { - Layout.fillWidth: true + Item { Layout.fillHeight: true; } + Spinner { + Layout.alignment: Qt.AlignHCenter + foreground: Nheko.colors.mid + } + Item { Layout.fillHeight: true; } + + RowLayout { + Button { + Layout.alignment: Qt.AlignLeft + text: qsTr("Cancel") + onClicked: { + flow.cancel(); + dialog.close(); } + } + Item { + Layout.fillWidth: true } } } + |