summaryrefslogtreecommitdiff
path: root/gui/components/Header.qml
blob: ee2d8861b019e2dbc6b190d1eae82c612002127b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import QtQuick 2.15
import QtQuick.Controls 2.4
import QtQuick.Dialogs 1.2
import QtQuick.Controls.Material 2.1

import "../themes/themes.js" as Theme

ToolBar {
    visible: stackView.depth > 1
    Material.foreground: Material.Black
    Material.background: customTheme.bgColor
    Material.elevation: 0

    contentHeight: settingsButton.implicitHeight

    ToolButton {
        id: settingsButton
        anchors {
            left: parent.left
            // margin needed at least for the Locations panel
            leftMargin: 5
        }
        font.pixelSize: Qt.application.font.pixelSize * 1.6
        icon.source: "../resources/arrow-left.svg"
        HoverHandler {
            cursorShape: Qt.PointingHandCursor
        }
        onClicked: {
            if (stackView.depth > 1) {
                stackView.pop()
            } else {
                settingsDrawer.open()
            }
        }
    }

    Label {
        text: stackView.currentItem.title
        font.bold: true
        anchors.centerIn: parent
    }
}