diff --git a/graphics/FannyLogo_small.png b/graphics/FannyLogo_small.png new file mode 100644 index 0000000..ac6d27a Binary files /dev/null and b/graphics/FannyLogo_small.png differ diff --git a/graphics/TreffpunktFannyLogo.png b/graphics/TreffpunktFannyLogo.png index 23872c7..b3ca429 100644 Binary files a/graphics/TreffpunktFannyLogo.png and b/graphics/TreffpunktFannyLogo.png differ diff --git a/graphics/icons/back.png b/graphics/icons/back.png new file mode 100644 index 0000000..d1740cd Binary files /dev/null and b/graphics/icons/back.png differ diff --git a/graphics/icons/back_black.png b/graphics/icons/back_black.png new file mode 100644 index 0000000..c55ab31 Binary files /dev/null and b/graphics/icons/back_black.png differ diff --git a/graphics/icons/drawer.png b/graphics/icons/drawer.png new file mode 100644 index 0000000..4e7899e Binary files /dev/null and b/graphics/icons/drawer.png differ diff --git a/graphics/icons/drawer_black.png b/graphics/icons/drawer_black.png new file mode 100644 index 0000000..eba3b6c Binary files /dev/null and b/graphics/icons/drawer_black.png differ diff --git a/graphics/icons/menu.png b/graphics/icons/menu.png new file mode 100644 index 0000000..5a0d148 Binary files /dev/null and b/graphics/icons/menu.png differ diff --git a/graphics/icons/menu_black.png b/graphics/icons/menu_black.png new file mode 100644 index 0000000..649c2a0 Binary files /dev/null and b/graphics/icons/menu_black.png differ diff --git a/qml/FoodPlanForm.qml b/qml/FoodPlanForm.qml index db419e5..35c1c05 100644 --- a/qml/FoodPlanForm.qml +++ b/qml/FoodPlanForm.qml @@ -8,6 +8,7 @@ Page { property bool cookplanChanged title: qsTr("Speiseplanplan") property string icon: "qrc:/graphics/TreffpunktFannyLogo.png" + property string link: "http://www.treffpunkt-fanny.de" // Image{ // source: "qrc:/graphics/chat_background.jpg"; diff --git a/qml/HomeForm.qml b/qml/HomeForm.qml index 5164979..aa9aa29 100644 --- a/qml/HomeForm.qml +++ b/qml/HomeForm.qml @@ -6,7 +6,8 @@ Page { //anchors.fill: parent title: qsTr("Vertretungsplan") - property string icon: "qrc:/graphics/FannyLogo.png" + property string icon: "qrc:/graphics/FannyLogo_small.png" + property string link: "http://www.fanny-leicht.de/j34" // Image{ // source: "qrc:/graphics/chat_background.jpg"; diff --git a/qml/MainPage.qml b/qml/MainPage.qml index e77e578..6e0806e 100644 --- a/qml/MainPage.qml +++ b/qml/MainPage.qml @@ -1,10 +1,12 @@ import QtQuick 2.9 import QtQuick.Controls 2.2 +import QtQuick.Layouts 1.1 +import QtQuick.Controls.Styles 1.2 + Page { id: root objectName: "MainPage" - //anchors.fill: parent Shortcut { sequences: ["Esc", "Back"] @@ -15,21 +17,18 @@ Page { } header: AppToolBar { - contentHeight: toolButton.implicitHeight - ToolButton { - id: toolButton + + Button { + id:toolButton + enabled: window.is_error === false anchors { left: parent.left verticalCenter: parent.verticalCenter - leftMargin: 5 - } - - background: Label { - text: stackView.depth > 1 ? "\u2BC7" : "\u4E09" - font.pixelSize: Qt.application.font.pixelSize * 2 - color: "white" + leftMargin: parent.width *0.02 } + height: parent.height - parent.height * 0.5 + width: height onClicked: { if (stackView.depth > 1) { @@ -38,6 +37,20 @@ Page { drawer.open() } } + + onPressed: toolButton.scale = 0.9 + onReleased: toolButton.scale = 1.0 + + background: Image { + source: stackView.depth > 1 ? "qrc:/graphics/icons/back.png" : "qrc:/graphics/icons/drawer.png" + height: parent.height + width: parent.width + Behavior on scale { + PropertyAnimation { + duration: 100 + } + } + } } Label { @@ -45,21 +58,35 @@ Page { anchors { verticalCenter: parent.verticalCenter left: toolButton.right - leftMargin: parent.width *0.01 + leftMargin: parent.width * 0.02 } - + font.bold: true color: "white" } Image { + id: logo source: stackView.currentItem.icon anchors.right: parent.right - anchors.rightMargin: parent.width *0.1 + anchors.rightMargin: parent.width * 0.02 anchors.top: parent.top height: parent.height fillMode: Image.PreserveAspectFit mipmap: true - asynchronous: true + Behavior on scale { + PropertyAnimation { + duration: 100 + } + } + MouseArea { + enabled: stackView.currentItem.link !== undefined && stackView.currentItem.objectName !== "WebsitePage" + anchors.fill: parent + onPressed: logo.scale = 0.9 + onReleased: logo.scale = 1.0 + onClicked: { + stackView.push("qrc:/WebsitePage.qml",{title: "Web", link: stackView.currentItem.link, icon: stackView.currentItem.icon}) + } + } } } @@ -100,7 +127,7 @@ Page { text: qsTr("Fanny Webseite") width: parent.width onClicked: { - stackView.push("WebsitePage.qml") + stackView.push("qrc:/WebsitePage.qml",{title: "Fanny Webseite", link: "http://www.fanny-leicht.de/j34", icon: stackView.currentItem.icon}) drawer.close() } } @@ -114,7 +141,7 @@ Page { drawer.close() busyDialog.close() if(ret === 200 || _cppServerConn.getFoodPlanData(1).cookteam !== ""){ - stackView.push("FoodPlanForm.qml") + stackView.push("qrc:/FoodPlanForm.qml") } } } @@ -133,6 +160,10 @@ Page { } width: parent.width + onClicked: { + confirmationDialog.open() + } + Dialog { id: confirmationDialog @@ -153,7 +184,7 @@ Page { onAccepted: { _cppServerConn.logout() drawer.close() - root.StackView.view.push("LoginPage.qml") + root.StackView.view.push("qrc:/LoginPage.qml") } } } @@ -162,7 +193,7 @@ Page { StackView { id: stackView - initialItem: "HomeForm.qml" + initialItem: "qrc:/HomeForm.qml" anchors.fill: parent } diff --git a/qml/WebsitePage.qml b/qml/WebsitePage.qml index dac2cb6..49b034e 100644 --- a/qml/WebsitePage.qml +++ b/qml/WebsitePage.qml @@ -8,12 +8,13 @@ import QtQuick.Controls.Styles 1.2 Page { id:root - //anchors.fill: parent objectName: "WebsitePage"; title: qsTr("Fanny Webseite") - property string icon: "qrc:/graphics/FannyLogo.png" + property string icon: "qrc:/graphics/FannyLogo_small.png" + + property string link: "http://www.fanny-leicht.de/j34" ProgressBar { id: progress @@ -28,6 +29,8 @@ Page { WebView { id: webView + Keys.onBackPressed: webView.goBack() + z: 0 anchors { top: webView.loadProgress < 100 ? progress.bottom:parent.top bottom: parent.bottom @@ -35,23 +38,11 @@ Page { right: parent.right } - url: "http://www.fanny-leicht.de/j34" + url: link onLoadingChanged: { + console.log(url) if (loadRequest.errorString) console.error(loadRequest.errorString); } - -// RoundButton { -// //z: -1 -// anchors { -// bottom: parent.bottom -// bottomMargin: 10 -// right: parent.right -// rightMargin: 10 -// } - -// text:"\u21BA" -// onClicked: webView.reload() -// } } } diff --git a/shared.qrc b/shared.qrc index eda4938..509ba29 100644 --- a/shared.qrc +++ b/shared.qrc @@ -6,5 +6,9 @@ graphics/chat_background.jpg graphics/FannyLogo.png graphics/TreffpunktFannyLogo.png + graphics/icons/back.png + graphics/icons/drawer.png + graphics/icons/menu.png + graphics/FannyLogo_small.png