AusweisApp2/resources/qml/Governikus/ResultView/+android/ResultView.qml

60 lines
1.5 KiB
QML
Raw Normal View History

2017-07-03 09:30:10 +02:00
import QtQuick 2.5
import QtQuick.Window 2.2
2017-12-20 14:54:05 +01:00
import Governikus.Global 1.0
import Governikus.TitleBar 1.0
2017-07-03 09:30:10 +02:00
SectionPage {
id: baseItem
2017-12-20 14:54:05 +01:00
leftTitleBarAction: TitleBarAction { state: "cancel"; onClicked: baseItem.clicked() }
2017-07-03 09:30:10 +02:00
property alias text: resultText.text
property bool isError: false
signal clicked
Rectangle {
anchors.fill: parent
color: Constants.background_color
}
// See: http://tagasks.com/in_qtqml_how_to_load_different_images_for_different_device_densities_android
property int ppi: Screen.pixelDensity * 25.4
Image {
id: resultImage
2018-03-28 15:10:51 +02:00
source: isError ? "qrc:///images/rotes_X.svg" : "qrc:///images/gruener_Haken.svg"
2017-07-03 09:33:28 +02:00
height: Utils.dp(100)
width: height
2017-07-03 09:30:10 +02:00
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
anchors.topMargin: Utils.dp(60)
fillMode: Image.PreserveAspectFit
}
Text {
id: resultText
width: parent.width * 0.9
2017-07-03 09:33:28 +02:00
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: resultImage.bottom
anchors.bottom: button.top
2017-07-03 09:30:10 +02:00
font.pixelSize: Constants.header_font_size
horizontalAlignment: Text.AlignHCenter
2017-07-03 09:33:28 +02:00
verticalAlignment: Text.AlignVCenter
2017-07-03 09:30:10 +02:00
wrapMode: Text.WordWrap
2017-12-20 14:54:05 +01:00
color: isError ? Constants.red : Constants.blue
2017-07-03 09:33:28 +02:00
onLinkActivated: Qt.openUrlExternally(link)
2017-07-03 09:30:10 +02:00
}
2017-12-20 14:54:05 +01:00
GButton {
2017-07-03 09:33:28 +02:00
id: button
2017-07-03 09:30:10 +02:00
width: Utils.dp(90)
anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottomMargin: Utils.dp(30)
2018-03-28 15:10:51 +02:00
text: qsTr("OK") + settingsModel.translationTrigger
2017-07-03 09:30:10 +02:00
onClicked: baseItem.clicked()
}
}