Fix emoji verification clipped on sway

fixes #917
This commit is contained in:
Nicolas Werner 2022-07-03 03:39:01 +02:00
parent 678806749d
commit f387e3b033
No known key found for this signature in database
GPG Key ID: C8D75E610773F2D9
7 changed files with 572 additions and 605 deletions

View File

@ -14,21 +14,29 @@ ApplicationWindow {
property var flow property var flow
onClosing: VerificationManager.removeVerificationFlow(flow) onClosing: VerificationManager.removeVerificationFlow(flow)
title: stack.currentItem.title_ title: stack.currentItem ? (stack.currentItem.title_ || "") : ""
modality: Qt.NonModal modality: Qt.NonModal
palette: Nheko.colors palette: Nheko.colors
color: Nheko.colors.window color: Nheko.colors.window
minimumHeight: stack.implicitHeight //height: stack.currentItem.implicitHeight
width: stack.implicitWidth minimumHeight: stack.currentItem.implicitHeight + 2 * Nheko.paddingLarge
height: stack.currentItem.implicitHeight + 2 * Nheko.paddingMedium
minimumWidth: 400
flags: Qt.Dialog | Qt.WindowCloseButtonHint | Qt.WindowTitleHint flags: Qt.Dialog | Qt.WindowCloseButtonHint | Qt.WindowTitleHint
background: Rectangle {
color: Nheko.colors.window
}
StackView { StackView {
id: stack id: stack
anchors.fill: parent anchors.centerIn: parent
initialItem: newVerificationRequest initialItem: newVerificationRequest
implicitWidth: currentItem.implicitWidth implicitWidth: dialog.width - 2* Nheko.paddingMedium
implicitHeight: currentItem.implicitHeight implicitHeight: dialog.height - 2* Nheko.paddingMedium
} }
Component { Component {
@ -86,7 +94,7 @@ ApplicationWindow {
name: "PromptStartVerification" name: "PromptStartVerification"
StateChangeScript { StateChangeScript {
script: stack.replace(newVerificationRequest) script: stack.replace(null, newVerificationRequest)
} }
}, },
@ -94,7 +102,7 @@ ApplicationWindow {
name: "CompareEmoji" name: "CompareEmoji"
StateChangeScript { StateChangeScript {
script: stack.replace(emojiVerification) script: stack.replace(null, emojiVerification)
} }
}, },
@ -102,7 +110,7 @@ ApplicationWindow {
name: "CompareNumber" name: "CompareNumber"
StateChangeScript { StateChangeScript {
script: stack.replace(digitVerification) script: stack.replace(null, digitVerification)
} }
}, },
@ -110,7 +118,7 @@ ApplicationWindow {
name: "WaitingForKeys" name: "WaitingForKeys"
StateChangeScript { StateChangeScript {
script: stack.replace(waiting) script: stack.replace(null, waiting)
} }
}, },
@ -118,7 +126,7 @@ ApplicationWindow {
name: "WaitingForOtherToAccept" name: "WaitingForOtherToAccept"
StateChangeScript { StateChangeScript {
script: stack.replace(waiting) script: stack.replace(null, waiting)
} }
}, },
@ -126,7 +134,7 @@ ApplicationWindow {
name: "WaitingForMac" name: "WaitingForMac"
StateChangeScript { StateChangeScript {
script: stack.replace(waiting) script: stack.replace(null, waiting)
} }
}, },
@ -134,7 +142,7 @@ ApplicationWindow {
name: "Success" name: "Success"
StateChangeScript { StateChangeScript {
script: stack.replace(success) script: stack.replace(null, success)
} }
}, },
@ -142,7 +150,7 @@ ApplicationWindow {
name: "Failed" name: "Failed"
StateChangeScript { StateChangeScript {
script: stack.replace(failed) script: stack.replace(null, failed)
} }
} }

View File

@ -8,14 +8,9 @@ import QtQuick.Controls 2.3
import QtQuick.Layouts 1.10 import QtQuick.Layouts 1.10
import im.nheko 1.0 import im.nheko 1.0
Pane {
property string title: qsTr("Verification Code")
background: Rectangle {
color: Nheko.colors.window
}
ColumnLayout { ColumnLayout {
anchors.fill: parent property string title: qsTr("Verification Code")
spacing: 16 spacing: 16
Label { Label {
@ -75,5 +70,3 @@ Pane {
} }
} }
}

View File

@ -8,14 +8,9 @@ import QtQuick.Controls 2.3
import QtQuick.Layouts 1.10 import QtQuick.Layouts 1.10
import im.nheko 1.0 import im.nheko 1.0
Pane {
property string title: qsTr("Verification Code")
background: Rectangle {
color: Nheko.colors.window
}
ColumnLayout { ColumnLayout {
anchors.fill: parent property string title: qsTr("Verification Code")
spacing: 16 spacing: 16
Label { Label {
@ -420,5 +415,3 @@ Pane {
} }
} }
}

View File

@ -8,14 +8,8 @@ import QtQuick.Controls 2.3
import QtQuick.Layouts 1.10 import QtQuick.Layouts 1.10
import im.nheko 1.0 import im.nheko 1.0
Pane {
property string title: qsTr("Verification failed")
background: Rectangle {
color: Nheko.colors.window
}
ColumnLayout { ColumnLayout {
anchors.fill: parent property string title: qsTr("Verification failed")
spacing: 16 spacing: 16
Text { Text {
@ -62,5 +56,3 @@ Pane {
} }
} }
}

View File

@ -8,14 +8,9 @@ import QtQuick.Controls 2.3
import QtQuick.Layouts 1.10 import QtQuick.Layouts 1.10
import im.nheko 1.0 import im.nheko 1.0
Pane {
property string title: flow.sender ? qsTr("Send Verification Request") : qsTr("Received Verification Request")
background: Rectangle {
color: Nheko.colors.window
}
ColumnLayout { ColumnLayout {
anchors.fill: parent property string title: flow.sender ? qsTr("Send Verification Request") : qsTr("Received Verification Request")
spacing: 16 spacing: 16
Label { Label {
@ -71,5 +66,3 @@ Pane {
} }
} }
}

View File

@ -8,14 +8,9 @@ import QtQuick.Controls 2.3
import QtQuick.Layouts 1.10 import QtQuick.Layouts 1.10
import im.nheko 1.0 import im.nheko 1.0
Pane {
property string title: qsTr("Successful Verification")
background: Rectangle {
color: Nheko.colors.window
}
ColumnLayout { ColumnLayout {
anchors.fill: parent property string title: qsTr("Successful Verification")
spacing: 16 spacing: 16
Label { Label {
@ -45,5 +40,3 @@ Pane {
} }
} }
}

View File

@ -9,14 +9,8 @@ import QtQuick.Controls 2.3
import QtQuick.Layouts 1.10 import QtQuick.Layouts 1.10
import im.nheko 1.0 import im.nheko 1.0
Pane {
property string title: qsTr("Waiting for other party…")
background: Rectangle {
color: Nheko.colors.window
}
ColumnLayout { ColumnLayout {
anchors.fill: parent property string title: qsTr("Waiting for other party…")
spacing: 16 spacing: 16
Label { Label {
@ -33,6 +27,8 @@ Pane {
return qsTr("Waiting for other side to continue the verification process."); return qsTr("Waiting for other side to continue the verification process.");
case "WaitingForMac": case "WaitingForMac":
return qsTr("Waiting for other side to complete the verification process."); return qsTr("Waiting for other side to complete the verification process.");
default:
return "";
} }
} }
color: Nheko.colors.text color: Nheko.colors.text
@ -64,4 +60,3 @@ Pane {
} }
}