2015-08-19 07:16:36 +00: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
|
|
|
|
import org.subsurfacedivelog.mobile 1.0
|
|
|
|
|
|
|
|
Rectangle {
|
2015-11-07 02:08:05 +00:00
|
|
|
id: topPart
|
|
|
|
|
|
|
|
property bool goBack: (stackView.depth > 1)
|
|
|
|
|
2015-10-09 03:05:23 +00:00
|
|
|
color: theme.accentColor
|
2015-11-07 02:08:05 +00:00
|
|
|
Layout.minimumHeight: units.gridUnit * 2 + units.smallSpacing * 2
|
2015-08-19 07:16:36 +00:00
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.margins: 0
|
|
|
|
RowLayout {
|
2015-11-07 02:08:05 +00:00
|
|
|
anchors.bottom: topPart.bottom
|
2015-11-06 21:52:30 +00:00
|
|
|
anchors.bottomMargin: units.smallSpacing
|
2015-11-07 02:08:05 +00:00
|
|
|
anchors.left: topPart.left
|
2015-11-06 21:52:30 +00:00
|
|
|
anchors.leftMargin: units.smallSpacing
|
2015-11-07 02:08:05 +00:00
|
|
|
anchors.right: topPart.right
|
2015-11-06 21:52:30 +00:00
|
|
|
anchors.rightMargin: units.smallSpacing
|
2015-11-07 02:08:05 +00:00
|
|
|
Image {
|
|
|
|
source: "qrc:/qml/subsurface-mobile-icon.png"
|
|
|
|
Layout.maximumWidth: units.gridUnit * 2
|
|
|
|
Layout.preferredWidth: units.gridUnit * 2
|
|
|
|
Layout.preferredHeight: units.gridUnit * 2
|
|
|
|
}
|
|
|
|
Text {
|
|
|
|
text: qsTr("Subsurface")
|
|
|
|
font.pointSize: units.fontMetrics.font.pointSize * 2
|
|
|
|
Layout.fillWidth: false
|
|
|
|
color: theme.accentTextColor
|
|
|
|
}
|
|
|
|
Item {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
}
|
2015-08-19 07:16:36 +00:00
|
|
|
Button {
|
2015-11-07 02:08:05 +00:00
|
|
|
id: prefsButton
|
|
|
|
// Display back arrow or menu button
|
|
|
|
text: topPart.goBack ? "\u2190" : "\u22ee"
|
|
|
|
anchors.right: parent.right
|
2015-10-09 03:05:23 +00:00
|
|
|
Layout.preferredWidth: units.gridUnit * 2
|
2015-11-07 02:08:05 +00:00
|
|
|
Layout.preferredHeight: parent.height
|
2015-08-19 07:16:36 +00:00
|
|
|
style: ButtonStyle {
|
|
|
|
background: Rectangle {
|
2015-10-09 03:05:23 +00:00
|
|
|
implicitWidth: units.gridUnit * 2
|
2015-11-07 02:08:05 +00:00
|
|
|
color: theme.accentColor
|
2015-08-19 07:16:36 +00:00
|
|
|
}
|
|
|
|
label: Text {
|
|
|
|
id: txt
|
2015-10-09 03:05:23 +00:00
|
|
|
color: theme.accentTextColor
|
2015-11-07 02:08:05 +00:00
|
|
|
font.pointSize: units.fontMetrics.font.pointSize * 2
|
2015-08-19 07:16:36 +00:00
|
|
|
font.bold: true
|
|
|
|
text: control.text
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
}
|
|
|
|
}
|
|
|
|
onClicked: {
|
2015-11-07 02:08:05 +00:00
|
|
|
if (topPart.goBack) {
|
|
|
|
stackView.pop()
|
|
|
|
} else {
|
|
|
|
prefsMenu.popup()
|
2015-08-20 08:44:01 +00:00
|
|
|
}
|
2015-08-19 07:16:36 +00:00
|
|
|
}
|
|
|
|
}
|
2015-11-07 02:08:05 +00:00
|
|
|
|
2015-08-19 07:16:36 +00:00
|
|
|
}
|
2015-11-07 02:08:05 +00:00
|
|
|
|
2015-08-19 07:16:36 +00:00
|
|
|
}
|