From 7253fb5794bd06f7227eacf9df9c3ca9f8108a07 Mon Sep 17 00:00:00 2001 From: Benjamin Dobell Date: Fri, 6 Mar 2015 05:15:46 +1100 Subject: Commenced UI overhaul for Heimdall Frontend 2.0 --- heimdall-frontend/source/main.cpp | 7 +- heimdall-frontend/source/qml/DropFiles.qml | 7 ++ heimdall-frontend/source/qml/DropFilesForm.ui.qml | 60 +++++++++++++ heimdall-frontend/source/qml/Root.qml | 7 ++ heimdall-frontend/source/qml/RootForm.ui.qml | 73 ++++++++++++++++ heimdall-frontend/source/qml/drop_zone.svg | 101 ++++++++++++++++++++++ heimdall-frontend/source/qml/main.qml | 63 ++++++++++++++ heimdall-frontend/source/qml/qml.qrc | 9 ++ heimdall-frontend/source/qml/resources.qrc | 5 ++ 9 files changed, 329 insertions(+), 3 deletions(-) create mode 100644 heimdall-frontend/source/qml/DropFiles.qml create mode 100644 heimdall-frontend/source/qml/DropFilesForm.ui.qml create mode 100644 heimdall-frontend/source/qml/Root.qml create mode 100644 heimdall-frontend/source/qml/RootForm.ui.qml create mode 100644 heimdall-frontend/source/qml/drop_zone.svg create mode 100644 heimdall-frontend/source/qml/main.qml create mode 100644 heimdall-frontend/source/qml/qml.qrc create mode 100644 heimdall-frontend/source/qml/resources.qrc (limited to 'heimdall-frontend/source') diff --git a/heimdall-frontend/source/main.cpp b/heimdall-frontend/source/main.cpp index 5d70e28..6373006 100644 --- a/heimdall-frontend/source/main.cpp +++ b/heimdall-frontend/source/main.cpp @@ -20,12 +20,13 @@ // Qt #include -#include +#include // Heimdall Frontend #include "mainwindow.h" #if defined(QT_STATIC) +#include Q_IMPORT_PLUGIN (QWindowsIntegrationPlugin); #endif @@ -35,8 +36,8 @@ int main(int argc, char *argv[]) { QApplication application(argc, argv); - MainWindow window; - window.show(); + QQmlApplicationEngine engine; + engine.load(QUrl(QString("qrc:/main.qml"))); return (application.exec()); } diff --git a/heimdall-frontend/source/qml/DropFiles.qml b/heimdall-frontend/source/qml/DropFiles.qml new file mode 100644 index 0000000..ac5c7a7 --- /dev/null +++ b/heimdall-frontend/source/qml/DropFiles.qml @@ -0,0 +1,7 @@ +import QtQuick 2.4 +import QtQuick.Controls 1.3 +import QtQuick.Layouts 1.1 + +DropFilesForm { + signal nextPressed(var files) +} diff --git a/heimdall-frontend/source/qml/DropFilesForm.ui.qml b/heimdall-frontend/source/qml/DropFilesForm.ui.qml new file mode 100644 index 0000000..3c9dd00 --- /dev/null +++ b/heimdall-frontend/source/qml/DropFilesForm.ui.qml @@ -0,0 +1,60 @@ +import QtQuick 2.4 +import QtQuick.Controls 1.3 +import QtQuick.Layouts 1.1 + +Rectangle { + Layout.preferredWidth: 420 + Layout.preferredHeight: 440 + color: "#eeeeee" + + DropArea { + id: dropFilesArea + } + + Column { + id: dropFilesColumn + spacing: 12 + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter + + Text { + id: dragFilesText + text: qsTr("Drop firmware files here") + opacity: 1 + anchors.horizontalCenter: parent.horizontalCenter + wrapMode: Text.WordWrap + horizontalAlignment: Text.AlignLeft + font.pixelSize: 18 + } + + Image { + id: image1 + width: 100 + height: 100 + opacity: 1 + anchors.horizontalCenter: parent.horizontalCenter + source: "drop_zone.svg" + } + + Button { + id: browseButton + text: qsTr("Browse") + isDefault: true + anchors.horizontalCenter: parent.horizontalCenter + } + } + + Button { + id: flashButton + x: 556 + y: 606 + text: qsTr("Next") + visible: false + enabled: true + isDefault: true + anchors.bottom: parent.bottom + anchors.bottomMargin: 8 + anchors.right: parent.right + anchors.rightMargin: 8 + } +} diff --git a/heimdall-frontend/source/qml/Root.qml b/heimdall-frontend/source/qml/Root.qml new file mode 100644 index 0000000..9dae2f6 --- /dev/null +++ b/heimdall-frontend/source/qml/Root.qml @@ -0,0 +1,7 @@ +import QtQuick 2.4 +import QtQuick.Controls 1.3 +import QtQuick.Layouts 1.1 + +RootForm { + signal commenceFlash (var files) +} diff --git a/heimdall-frontend/source/qml/RootForm.ui.qml b/heimdall-frontend/source/qml/RootForm.ui.qml new file mode 100644 index 0000000..bc97a58 --- /dev/null +++ b/heimdall-frontend/source/qml/RootForm.ui.qml @@ -0,0 +1,73 @@ +import QtQuick 2.4 +import QtQuick.Controls 1.3 +import QtQuick.Layouts 1.1 + +Rectangle { + id: rectangle1 + width: 620 + height: 460 + color: "#eeeeee" + + RowLayout { + id: rowLayout1 + anchors.fill: parent + + Rectangle { + id: rectangle6 + color: "#222222" + width: 180 + anchors.top: parent.top + anchors.topMargin: 0 + anchors.bottom: parent.bottom + anchors.bottomMargin: 0 + + ListView { + id: listView1 + anchors.fill: parent + delegate: Item { + anchors.right: parent.right + anchors.rightMargin: 0 + anchors.left: parent.left + anchors.leftMargin: 0 + height: 40 + Row { + spacing: 8 + + Rectangle { + width: 40 + height: 40 + color: colorCode + } + + Text { + text: name + color: '#eeeeee' + anchors.verticalCenter: parent.verticalCenter + } + } + } + model: ListModel { + ListElement { + name: "Load Firmware" + colorCode: "red" + } + + ListElement { + name: "Utilities" + colorCode: "blue" + } + + ListElement { + name: "Configuration" + colorCode: "green" + } + } + } + } + DropFiles { + id: dropFiles1 + Layout.fillWidth: true + } + } + +} diff --git a/heimdall-frontend/source/qml/drop_zone.svg b/heimdall-frontend/source/qml/drop_zone.svg new file mode 100644 index 0000000..6e92752 --- /dev/null +++ b/heimdall-frontend/source/qml/drop_zone.svg @@ -0,0 +1,101 @@ + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/heimdall-frontend/source/qml/main.qml b/heimdall-frontend/source/qml/main.qml new file mode 100644 index 0000000..a6bb483 --- /dev/null +++ b/heimdall-frontend/source/qml/main.qml @@ -0,0 +1,63 @@ +import QtQuick 2.4 +import QtQuick.Controls 1.3 +import QtQuick.Window 2.2 +import QtQuick.Dialogs 1.2 +import QtQuick.Layouts 1.1 + +ApplicationWindow { + title: qsTr("Heimdall Frontend") + minimumWidth: 620 + minimumHeight: 460 + width: 640 + height: 480 + visible: true + + menuBar: MenuBar { + Menu { + title: qsTr("&File") + MenuItem { + text: qsTr("&Open") + onTriggered: messageDialog.show(qsTr("Open action triggered")); + } + MenuItem { + text: qsTr("E&xit") + onTriggered: Qt.quit(); + } + } + } + + StackView { + id: stack + initialItem: root + anchors.fill: parent + + Root { + id: root + anchors.fill: parent + } + + function transitionFinished(properties) + { + properties.exitItem.x = 0 + } + + delegate: StackViewDelegate { + pushTransition: StackViewTransition { + PropertyAnimation { + target: enterItem + property: "x" + from: target.width + to: 0 + duration: 300 + } + PropertyAnimation { + target: exitItem + property: "x" + from: 0 + to: target.width + duration: 300 + } + } + } + } +} diff --git a/heimdall-frontend/source/qml/qml.qrc b/heimdall-frontend/source/qml/qml.qrc new file mode 100644 index 0000000..5dbe3d0 --- /dev/null +++ b/heimdall-frontend/source/qml/qml.qrc @@ -0,0 +1,9 @@ + + + main.qml + Root.qml + RootForm.ui.qml + DropFiles.qml + DropFilesForm.ui.qml + + \ No newline at end of file diff --git a/heimdall-frontend/source/qml/resources.qrc b/heimdall-frontend/source/qml/resources.qrc new file mode 100644 index 0000000..4d9d39e --- /dev/null +++ b/heimdall-frontend/source/qml/resources.qrc @@ -0,0 +1,5 @@ + + + drop_zone.svg + + \ No newline at end of file -- cgit v1.2.3