Skip to content

Commit 989c49b

Browse files
committed
qml: refactor initerror window
refactor initerror window to adhere to designers specification
1 parent 2a7dfa8 commit 989c49b

File tree

2 files changed

+70
-12
lines changed

2 files changed

+70
-12
lines changed

src/qml/bitcoin.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ bool InitErrorMessageBox(
6767
{
6868
QQmlApplicationEngine engine;
6969
engine.rootContext()->setContextProperty("message", QString::fromStdString(message.translated));
70+
engine.addImageProvider(QStringLiteral("images"), new ImageProvider{NULL});
7071
engine.load(QUrl(QStringLiteral("qrc:///qml/pages/initerrormessage.qml")));
7172
if (engine.rootObjects().isEmpty()) {
7273
return EXIT_FAILURE;

src/qml/pages/initerrormessage.qml

Lines changed: 69 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,79 @@
44

55
import QtQuick 2.15
66
import QtQuick.Controls 2.15
7+
import QtQuick.Layouts 1.15
8+
import "../controls"
79

810
ApplicationWindow {
9-
title: "Bitcoin Core TnG"
11+
id: root
1012
visible: true
1113
minimumWidth: 500
12-
minimumHeight: 200
14+
minimumHeight: 250
15+
color: "transparent"
16+
flags: Qt.FramelessWindowHint
17+
background: Rectangle {
18+
color: Theme.color.background
19+
radius: 10
20+
}
21+
menuBar: RowLayout {
22+
width: parent.width
23+
height: 55
24+
25+
DragHandler {
26+
id: menuHandler
27+
grabPermissions: TapHandler.CanTakeOverFromAnything
28+
onActiveChanged: if (active) { root.startSystemMove(); }
29+
target: null
30+
}
31+
Rectangle {
32+
width: 55
33+
color: "green"
34+
}
35+
Header {
36+
Layout.fillWidth: true
37+
Layout.alignment: Qt.AlignCenter
38+
bold: true
39+
header: "Error"
40+
headerSize: 24
41+
}
42+
Button {
43+
id: icon_button
44+
implicitWidth: 55
45+
icon.source: "image://images/cross"
46+
icon.color: Theme.color.neutral9
47+
icon.width: 20
48+
background: null
49+
onClicked: Qt.quit()
50+
}
51+
}
52+
53+
DragHandler {
54+
id: moveHandler
55+
grabPermissions: TapHandler.CanTakeOverFromAnything
56+
onActiveChanged: if (active) { root.startSystemMove(); }
57+
target: null
58+
}
59+
Rectangle {
60+
anchors.bottom: root.menuBar.bottom
61+
width: root.width
62+
height: 1
63+
color: Theme.color.neutral5
64+
}
65+
ColumnLayout {
66+
spacing: 30
67+
anchors.top: parent.top
68+
anchors.horizontalCenter: parent.horizontalCenter
1369

14-
Dialog {
15-
anchors.centerIn: parent
16-
title: qsTr("Error")
17-
contentItem:
18-
Label {
19-
text: message
20-
}
21-
visible: true
22-
standardButtons: Dialog.Ok
23-
onAccepted: Qt.quit()
70+
Header {
71+
Layout.topMargin: 30
72+
Layout.fillWidth: true
73+
header: message
74+
headerSize: 18
75+
}
76+
OutlineButton {
77+
Layout.alignment: Qt.AlignCenter
78+
text: "OK"
79+
onClicked: Qt.quit()
80+
}
2481
}
2582
}

0 commit comments

Comments
 (0)