2015-08-19 10:16:36 +03:00
|
|
|
import QtQuick 2.3
|
|
|
|
import QtQuick.Controls 1.2
|
|
|
|
import QtQuick.Controls.Styles 1.2
|
|
|
|
import QtQuick.Window 2.2
|
|
|
|
import QtQuick.Dialogs 1.2
|
|
|
|
import QtQuick.Layouts 1.1
|
|
|
|
import QtQuick.Window 2.2
|
2015-11-29 17:27:20 +01:00
|
|
|
import org.kde.plasma.mobilecomponents 0.2 as MobileComponents
|
2015-08-19 10:16:36 +03:00
|
|
|
import org.subsurfacedivelog.mobile 1.0
|
|
|
|
|
|
|
|
Rectangle {
|
2015-11-07 03:08:05 +01:00
|
|
|
id: topPart
|
|
|
|
|
|
|
|
property bool goBack: (stackView.depth > 1)
|
|
|
|
|
2015-11-29 19:21:27 +01:00
|
|
|
color: subsurfaceTheme.accentColor
|
2016-01-26 14:55:23 -02:00
|
|
|
Layout.minimumHeight: Math.round(MobileComponents.Units.gridUnit * 2.5)
|
2015-08-19 10:16:36 +03:00
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.margins: 0
|
|
|
|
RowLayout {
|
2015-11-07 03:08:05 +01:00
|
|
|
anchors.bottom: topPart.bottom
|
2015-11-30 01:04:09 +01:00
|
|
|
anchors.bottomMargin: MobileComponents.Units.smallSpacing
|
2015-11-07 03:08:05 +01:00
|
|
|
anchors.left: topPart.left
|
2015-11-30 01:13:51 +01:00
|
|
|
anchors.leftMargin: MobileComponents.Units.smallSpacing
|
2015-11-07 03:08:05 +01:00
|
|
|
anchors.right: topPart.right
|
2015-11-30 01:13:51 +01:00
|
|
|
anchors.rightMargin: MobileComponents.Units.smallSpacing
|
2016-01-04 13:01:08 -08:00
|
|
|
Item {
|
|
|
|
id: mainMenu
|
|
|
|
anchors.left: parent.left
|
|
|
|
Layout.preferredHeight: mainMenuIcon.height
|
|
|
|
width: mainMenuIcon.width
|
|
|
|
Image {
|
|
|
|
id: mainMenuIcon
|
|
|
|
source: "qrc:/qml/main-menu.png"
|
2016-01-26 14:55:23 -02:00
|
|
|
width: Math.round(MobileComponents.Units.gridUnit * 1.5)
|
2016-01-04 13:01:08 -08:00
|
|
|
height: width
|
|
|
|
anchors {
|
|
|
|
top: parent.top
|
|
|
|
topMargin: MobileComponents.Units.smallSpacing * -1
|
|
|
|
leftMargin: MobileComponents.Units.smallSpacing
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
MouseArea {
|
|
|
|
height: parent.height
|
|
|
|
width: parent.width
|
|
|
|
onClicked: {
|
|
|
|
globalDrawer.open()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2015-11-07 03:32:37 +01:00
|
|
|
Item {
|
|
|
|
Layout.preferredHeight: subsurfaceLogo.height
|
2015-11-30 01:04:09 +01:00
|
|
|
Rectangle { color: "green"; anchors.fill: parent; }
|
2015-11-07 03:32:37 +01:00
|
|
|
Image {
|
|
|
|
id: subsurfaceLogo
|
|
|
|
source: "qrc:/qml/subsurface-mobile-icon.png"
|
|
|
|
anchors {
|
|
|
|
top: parent.top
|
2015-11-30 01:04:09 +01:00
|
|
|
topMargin: MobileComponents.Units.smallSpacing * -1
|
2015-11-07 03:32:37 +01:00
|
|
|
left: parent.left
|
|
|
|
}
|
2016-01-26 14:55:23 -02:00
|
|
|
width: Math.round(MobileComponents.Units.gridUnit * 1.7)
|
2015-11-07 03:32:37 +01:00
|
|
|
height: width
|
|
|
|
}
|
2015-11-30 01:04:09 +01:00
|
|
|
MobileComponents.Label {
|
2016-01-01 09:34:32 -08:00
|
|
|
text: qsTr("Subsurface-mobile")
|
2016-01-26 14:55:23 -02:00
|
|
|
font.pointSize: Math.round(MobileComponents.Theme.defaultFont.pointSize * 1.3)
|
2016-01-04 21:38:44 -08:00
|
|
|
height: subsurfaceLogo.height * 2
|
2015-11-07 03:32:37 +01:00
|
|
|
anchors {
|
|
|
|
left: subsurfaceLogo.right
|
|
|
|
bottom: subsurfaceLogo.bottom
|
2016-01-26 14:55:23 -02:00
|
|
|
leftMargin: Math.round(MobileComponents.Units.gridUnit / 2)
|
2015-11-07 03:32:37 +01:00
|
|
|
}
|
2015-11-30 01:04:09 +01:00
|
|
|
font.weight: Font.Light
|
2015-11-07 03:32:37 +01:00
|
|
|
verticalAlignment: Text.AlignBottom
|
|
|
|
Layout.fillWidth: false
|
2015-11-29 19:21:27 +01:00
|
|
|
color: subsurfaceTheme.accentTextColor
|
2015-11-07 03:32:37 +01:00
|
|
|
}
|
2015-11-07 03:08:05 +01:00
|
|
|
}
|
|
|
|
Item {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
}
|
2016-02-07 22:23:06 +01:00
|
|
|
Item {
|
|
|
|
id: editButton
|
2016-02-09 21:38:59 +01:00
|
|
|
anchors.right: backButton.visible ? backButton.left : contextDrawer.enabled ? contextMenu.left : parent.right
|
2016-02-07 22:23:06 +01:00
|
|
|
anchors.top: parent.top
|
|
|
|
Layout.preferredHeight: editButtonIcon.height
|
|
|
|
width: editButtonIcon.width
|
2016-02-09 21:38:59 +01:00
|
|
|
visible: detailsWindow.state === "view" && detailsWindow.visible
|
2016-02-07 22:23:06 +01:00
|
|
|
Image {
|
|
|
|
id: editButtonIcon
|
|
|
|
source: "qrc:/qml/menu-edit.png"
|
|
|
|
anchors {
|
|
|
|
top: parent.top
|
|
|
|
right: parent.right
|
|
|
|
topMargin: MobileComponents.Units.smallSpacing * -1
|
|
|
|
rightMargin: MobileComponents.Units.smallSpacing
|
|
|
|
}
|
|
|
|
width: Math.round(MobileComponents.Units.gridUnit * 1.7)
|
|
|
|
height: width
|
|
|
|
}
|
|
|
|
MouseArea {
|
|
|
|
height: parent.height
|
|
|
|
width: parent.width
|
|
|
|
onClicked: {
|
|
|
|
detailsWindow.startEditMode()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Item {
|
|
|
|
id: backButton
|
2016-02-09 06:33:16 -08:00
|
|
|
anchors.right: contextDrawer.enabled ? contextMenu.left : parent.right
|
2016-02-07 22:23:06 +01:00
|
|
|
anchors.top: parent.top
|
|
|
|
Layout.preferredHeight: backButtonIcon.height
|
|
|
|
width: backButtonIcon.width
|
2016-02-09 21:38:59 +01:00
|
|
|
visible: logWindow.visible || themetest.visible || detailsWindow.visible
|
2016-02-07 22:23:06 +01:00
|
|
|
Image {
|
|
|
|
id: backButtonIcon
|
|
|
|
source: "qrc:/qml/menu-back.png"
|
|
|
|
anchors {
|
|
|
|
top: parent.top
|
|
|
|
right: parent.right
|
|
|
|
topMargin: MobileComponents.Units.smallSpacing * -1
|
|
|
|
rightMargin: MobileComponents.Units.smallSpacing
|
|
|
|
}
|
|
|
|
width: Math.round(MobileComponents.Units.gridUnit * 1.7)
|
|
|
|
height: width
|
|
|
|
}
|
|
|
|
MouseArea {
|
|
|
|
height: parent.height
|
|
|
|
width: parent.width
|
|
|
|
onClicked: {
|
2016-02-09 21:38:59 +01:00
|
|
|
if (detailsWindow.state === "view" || logWindow.visible || themetest.visible)
|
2016-02-09 20:39:31 +01:00
|
|
|
stackView.pop()
|
2016-02-09 21:38:59 +01:00
|
|
|
if (detailsWindow.state === "edit")
|
2016-02-09 20:39:31 +01:00
|
|
|
detailsWindow.endEditMode()
|
2016-02-07 22:23:06 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-01-04 13:01:42 -08:00
|
|
|
Item {
|
|
|
|
id: contextMenu
|
|
|
|
visible: contextDrawer.enabled
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.top: parent.top
|
|
|
|
Layout.preferredHeight: contextMenuIcon.height
|
|
|
|
width: contextMenuIcon.width
|
|
|
|
Image {
|
|
|
|
id: contextMenuIcon
|
|
|
|
source: "qrc:/qml/context-menu.png"
|
2016-01-26 14:55:23 -02:00
|
|
|
width: Math.round(MobileComponents.Units.gridUnit * 1.5)
|
2016-01-04 13:01:42 -08:00
|
|
|
height: width
|
|
|
|
anchors {
|
|
|
|
top: parent.top
|
|
|
|
right: parent.right
|
|
|
|
topMargin: MobileComponents.Units.smallSpacing * -1
|
|
|
|
rightMargin: MobileComponents.Units.smallSpacing
|
|
|
|
}
|
|
|
|
}
|
|
|
|
MouseArea {
|
|
|
|
height: parent.height
|
|
|
|
width: parent.width
|
|
|
|
onClicked: {
|
|
|
|
contextDrawer.open()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2015-08-19 10:16:36 +03:00
|
|
|
}
|
|
|
|
}
|