Skip to content
Snippets Groups Projects
Verified Commit f7fd2266 authored by Burak Hançerli's avatar Burak Hançerli :headphones:
Browse files

fix: ui is shown properly now

parent 3fe6ce35
No related branches found
No related tags found
No related merge requests found
Pipeline #62178 passed
/* /*
This is a UI file (.ui.qml) that is intended to be edited in Qt Design Studio only. This is a UI file (.ui.qml) that is intended to be edited in Qt Design Studio only.
It is supposed to be strictly declarative and only uses a subset of QML. If you edit It is supposed to be strictly declarative and only uses a subset of QML. If you edit
...@@ -14,9 +13,8 @@ import QtQuick.Window 2.2 ...@@ -14,9 +13,8 @@ import QtQuick.Window 2.2
Rectangle { Rectangle {
id: root id: root
width: Screen.desktopAvailableWidth width: 400
height: Screen.desktopAvailableHeigth height: 800
color: "#EAEAEA" color: "#EAEAEA"
Material.theme: Material.Light Material.theme: Material.Light
...@@ -25,7 +23,7 @@ Rectangle { ...@@ -25,7 +23,7 @@ Rectangle {
ColumnLayout { ColumnLayout {
id: bar id: bar
y: 408 y: 50
anchors.bottom: column.top anchors.bottom: column.top
anchors.bottomMargin: 24 anchors.bottomMargin: 24
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
...@@ -39,7 +37,6 @@ Rectangle { ...@@ -39,7 +37,6 @@ Rectangle {
ColumnLayout { ColumnLayout {
id: column id: column
y: 549
height: 113 height: 113
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
...@@ -66,41 +63,48 @@ Rectangle { ...@@ -66,41 +63,48 @@ Rectangle {
Item { Item {
id: header id: header
width: 351 width: 351
height: 309 height: gridLayout.height
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 12 anchors.topMargin: 12
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
Image { GridLayout {
id: qdsicon id: gridLayout
x: 47
y: -23
source: "dvicon.png"
fillMode: Image.PreserveAspectFit
}
ColumnLayout {
anchors.top: qdsicon.bottom
anchors.horizontalCenterOffset: -1
anchors.topMargin: -20
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
Label { rows: root.height > 420 ? 2 : 1
id: label columns: root.height > 420 ? 1 : 2
text: qsTr("Android Design Viewer")
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter Image {
id: qdsicon
x: 47
y: -23
width: 204
height: 202
source: "dvicon.png"
fillMode: Image.PreserveAspectFit
} }
Label { ColumnLayout {
id: label1
text: qsTr("Technology Preview")
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
}
Label { Label {
id: label2 id: label
text: backend.buildInfo text: qsTr("Android Design Viewer")
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
horizontalAlignment: "AlignHCenter" }
Label {
id: label1
text: qsTr("Technology Preview")
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
}
Label {
id: label2
text: backend.buildInfo
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
horizontalAlignment: "AlignHCenter"
}
} }
} }
} }
...@@ -108,43 +112,39 @@ Rectangle { ...@@ -108,43 +112,39 @@ Rectangle {
Rectangle { Rectangle {
id: log id: log
visible: root.height > 620 visible: root.height > 620
color: "#ececec" color: "#EAEAEA"
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.top: header.bottom anchors.top: header.bottom
anchors.bottom: bar.top anchors.bottom: bar.top
anchors.topMargin: 0 anchors.topMargin: 15
anchors.bottomMargin: 24 anchors.bottomMargin: 24
anchors.leftMargin: 22 anchors.leftMargin: 22
Label {
id: label3
visible: false
text: qsTr("Log")
anchors.top: parent.top
anchors.topMargin: 12
anchors.horizontalCenter: parent.horizontalCenter
font.bold: true
}
ScrollView { ScrollView {
id: scrollArea id: scrollArea
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.top: label3.bottom anchors.top: parent.top
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
topPadding: 13.1
clip: false
anchors.topMargin: 9
anchors.rightMargin: 2 anchors.rightMargin: 2
TextArea { Item {
id: logTextArea
text: backend.logs
rightInset: 20
readOnly: true
clip: false
anchors.topMargin: 5
placeholderText: qsTr("Application Logs")
width: scrollArea.width width: scrollArea.width
height: logTextArea.height
TextArea {
y: 20
id: logTextArea
text: backend.logs
rightInset: 20
width: scrollArea.width
readOnly: true
anchors.topMargin: 5
placeholderText: qsTr("Application Logs")
}
} }
} }
} }
......
...@@ -57,7 +57,7 @@ Backend::Backend(QObject *parent) ...@@ -57,7 +57,7 @@ Backend::Backend(QObject *parent)
printLog("-- Screen width: " + QSTRN(screenGeometry.width())); printLog("-- Screen width: " + QSTRN(screenGeometry.width()));
m_buildInfo = QCoreApplication::applicationVersion() + "\n" + "Qt " + QString(QT_VERSION_STR) m_buildInfo = QCoreApplication::applicationVersion() + "\n" + "Qt " + QString(QT_VERSION_STR)
+ "\n" + "OpenSSL support: " + QVariant(QSslSocket::supportsSsl()).toString(); + " - OpenSSL support: " + QVariant(QSslSocket::supportsSsl()).toString();
emit buildInfoChanged(); emit buildInfoChanged();
printLog("Initialization complete"); printLog("Initialization complete");
} }
......
...@@ -47,7 +47,12 @@ int main(int argc, char *argv[]) ...@@ -47,7 +47,12 @@ int main(int argc, char *argv[])
QQuickView view; QQuickView view;
view.engine()->rootContext()->setContextProperty("backend", &backend); view.engine()->rootContext()->setContextProperty("backend", &backend);
view.setSource(QUrl(QStringLiteral("qrc:/main.qml"))); view.setSource(QUrl(QStringLiteral("qrc:/main.qml")));
view.show(); view.setResizeMode(QQuickView::SizeRootObjectToView);
view.showMaximized();
QThread::msleep(2000);
// backend.downloadAndRun("https://designviewer.qt.io/#17e8907b3b84b8206d45be4f551f4e25/"
// "MaterialBundle.qmlrc");
return app.exec(); return app.exec();
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment