more graphical improvements

This commit is contained in:
Dorian Zedler 2018-07-19 20:08:46 +02:00
parent 50b2ff7699
commit 57b1f7f12f
13 changed files with 64 additions and 36 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 KiB

After

Width:  |  Height:  |  Size: 16 KiB

BIN
graphics/icons/back.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 B

BIN
graphics/icons/drawer.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 B

BIN
graphics/icons/menu.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 B

View file

@ -8,6 +8,7 @@ Page {
property bool cookplanChanged property bool cookplanChanged
title: qsTr("Speiseplanplan") title: qsTr("Speiseplanplan")
property string icon: "qrc:/graphics/TreffpunktFannyLogo.png" property string icon: "qrc:/graphics/TreffpunktFannyLogo.png"
property string link: "http://www.treffpunkt-fanny.de"
// Image{ // Image{
// source: "qrc:/graphics/chat_background.jpg"; // source: "qrc:/graphics/chat_background.jpg";

View file

@ -6,7 +6,8 @@ Page {
//anchors.fill: parent //anchors.fill: parent
title: qsTr("Vertretungsplan") 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{ // Image{
// source: "qrc:/graphics/chat_background.jpg"; // source: "qrc:/graphics/chat_background.jpg";

View file

@ -1,10 +1,12 @@
import QtQuick 2.9 import QtQuick 2.9
import QtQuick.Controls 2.2 import QtQuick.Controls 2.2
import QtQuick.Layouts 1.1
import QtQuick.Controls.Styles 1.2
Page { Page {
id: root id: root
objectName: "MainPage" objectName: "MainPage"
//anchors.fill: parent
Shortcut { Shortcut {
sequences: ["Esc", "Back"] sequences: ["Esc", "Back"]
@ -15,21 +17,18 @@ Page {
} }
header: AppToolBar { header: AppToolBar {
contentHeight: toolButton.implicitHeight
ToolButton {
Button {
id:toolButton id:toolButton
enabled: window.is_error === false
anchors { anchors {
left: parent.left left: parent.left
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
leftMargin: 5 leftMargin: parent.width *0.02
}
background: Label {
text: stackView.depth > 1 ? "\u2BC7" : "\u4E09"
font.pixelSize: Qt.application.font.pixelSize * 2
color: "white"
} }
height: parent.height - parent.height * 0.5
width: height
onClicked: { onClicked: {
if (stackView.depth > 1) { if (stackView.depth > 1) {
@ -38,6 +37,20 @@ Page {
drawer.open() 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 { Label {
@ -45,21 +58,35 @@ Page {
anchors { anchors {
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
left: toolButton.right left: toolButton.right
leftMargin: parent.width *0.01 leftMargin: parent.width * 0.02
} }
font.bold: true
color: "white" color: "white"
} }
Image { Image {
id: logo
source: stackView.currentItem.icon source: stackView.currentItem.icon
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: parent.width *0.1 anchors.rightMargin: parent.width * 0.02
anchors.top: parent.top anchors.top: parent.top
height: parent.height height: parent.height
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
mipmap: true 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") text: qsTr("Fanny Webseite")
width: parent.width width: parent.width
onClicked: { 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() drawer.close()
} }
} }
@ -114,7 +141,7 @@ Page {
drawer.close() drawer.close()
busyDialog.close() busyDialog.close()
if(ret === 200 || _cppServerConn.getFoodPlanData(1).cookteam !== ""){ if(ret === 200 || _cppServerConn.getFoodPlanData(1).cookteam !== ""){
stackView.push("FoodPlanForm.qml") stackView.push("qrc:/FoodPlanForm.qml")
} }
} }
} }
@ -133,6 +160,10 @@ Page {
} }
width: parent.width width: parent.width
onClicked: {
confirmationDialog.open()
}
Dialog { Dialog {
id: confirmationDialog id: confirmationDialog
@ -153,7 +184,7 @@ Page {
onAccepted: { onAccepted: {
_cppServerConn.logout() _cppServerConn.logout()
drawer.close() drawer.close()
root.StackView.view.push("LoginPage.qml") root.StackView.view.push("qrc:/LoginPage.qml")
} }
} }
} }
@ -162,7 +193,7 @@ Page {
StackView { StackView {
id: stackView id: stackView
initialItem: "HomeForm.qml" initialItem: "qrc:/HomeForm.qml"
anchors.fill: parent anchors.fill: parent
} }

View file

@ -8,12 +8,13 @@ import QtQuick.Controls.Styles 1.2
Page { Page {
id:root id:root
//anchors.fill: parent
objectName: "WebsitePage"; objectName: "WebsitePage";
title: qsTr("Fanny Webseite") 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 { ProgressBar {
id: progress id: progress
@ -28,6 +29,8 @@ Page {
WebView { WebView {
id: webView id: webView
Keys.onBackPressed: webView.goBack()
z: 0
anchors { anchors {
top: webView.loadProgress < 100 ? progress.bottom:parent.top top: webView.loadProgress < 100 ? progress.bottom:parent.top
bottom: parent.bottom bottom: parent.bottom
@ -35,23 +38,11 @@ Page {
right: parent.right right: parent.right
} }
url: "http://www.fanny-leicht.de/j34" url: link
onLoadingChanged: { onLoadingChanged: {
console.log(url)
if (loadRequest.errorString) if (loadRequest.errorString)
console.error(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()
// }
} }
} }

View file

@ -6,5 +6,9 @@
<file>graphics/chat_background.jpg</file> <file>graphics/chat_background.jpg</file>
<file>graphics/FannyLogo.png</file> <file>graphics/FannyLogo.png</file>
<file>graphics/TreffpunktFannyLogo.png</file> <file>graphics/TreffpunktFannyLogo.png</file>
<file>graphics/icons/back.png</file>
<file>graphics/icons/drawer.png</file>
<file>graphics/icons/menu.png</file>
<file>graphics/FannyLogo_small.png</file>
</qresource> </qresource>
</RCC> </RCC>