PixsBar.qml 4.79 KB
Newer Older
Camilo Higuita's avatar
Camilo Higuita committed
1 2 3 4 5
import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import "../utils/Icons.js" as MdiFont
import "../utils"
6
import "../view_models"
Camilo Higuita's avatar
Camilo Higuita committed
7 8 9 10


ToolBar
{
11 12
    position: ToolBar.Header

Camilo Higuita's avatar
Camilo Higuita committed
13
    property string accentColor : pix.pixColor()
14
    property string textColor : textColor
Camilo Higuita's avatar
Camilo Higuita committed
15 16 17

    property int currentIndex : 0

Camilo Higuita's avatar
Camilo Higuita committed
18
    signal viewerViewClicked()
Camilo Higuita's avatar
Camilo Higuita committed
19 20 21
    signal galleryViewClicked()
    signal albumsViewClicked()
    signal tagsViewClicked()
22
    signal foldersViewClicked()
23
    signal searchViewClicked()
Camilo Higuita's avatar
Camilo Higuita committed
24

25
    signal menuClicked()
Camilo Higuita's avatar
Camilo Higuita committed
26 27 28 29 30 31 32

    id: pixBar

    RowLayout
    {
        anchors.fill: parent

33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
        Item
        {
            Layout.alignment: Qt.AlignLeft
            Layout.fillWidth: true
            Layout.fillHeight: true

            PixButton
            {
                anchors.centerIn: parent

                iconName: "application-menu"
                onClicked: menuClicked()

                hoverEnabled: !isMobile
                ToolTip.delay: 1000
                ToolTip.timeout: 5000
                ToolTip.visible: hovered
                ToolTip.text: qsTr("Menu")
            }
        }

        Item { Layout.fillWidth: true }

56
        Item
Camilo Higuita's avatar
Camilo Higuita committed
57
        {
58
            Layout.alignment: Qt.AlignLeft
59 60
            Layout.fillWidth: true
            Layout.fillHeight: true
Camilo Higuita's avatar
Camilo Higuita committed
61

62
            PixButton
Camilo Higuita's avatar
Camilo Higuita committed
63
            {
64
                id: viewerView
65 66
                anchors.centerIn: parent
                iconColor: currentIndex === views.viewer? accentColor : textColor
67

68
                iconName: "view-preview"
Camilo Higuita's avatar
Camilo Higuita committed
69
                onClicked: viewerViewClicked()
70

71
                hoverEnabled: !isMobile
72 73 74
                ToolTip.delay: 1000
                ToolTip.timeout: 5000
                ToolTip.visible: hovered
75
                ToolTip.text: qsTr("Viewer")
76 77 78
            }
        }

79
        Item
80
        {
81 82
            Layout.fillWidth: true
            Layout.fillHeight: true
83

84
            PixButton
85 86
            {
                id: galleryBtn
87
                anchors.centerIn: parent
Camilo Higuita's avatar
Camilo Higuita committed
88

89 90 91
                iconColor: currentIndex === views.gallery? accentColor : textColor

                iconName: "image-frames"
Camilo Higuita's avatar
Camilo Higuita committed
92 93
                onClicked: galleryViewClicked()

94
                hoverEnabled: !isMobile
Camilo Higuita's avatar
Camilo Higuita committed
95 96 97 98 99
                ToolTip.delay: 1000
                ToolTip.timeout: 5000
                ToolTip.visible: hovered
                ToolTip.text: qsTr("Gallery")
            }
100 101 102 103 104 105
        }

        Item
        {
            Layout.fillWidth: true
            Layout.fillHeight: true
Camilo Higuita's avatar
Camilo Higuita committed
106

107
            PixButton
108 109
            {
                id: foldersView
110
                anchors.centerIn: parent
111

112
                iconColor: currentIndex === views.folders? accentColor : textColor
113

114
                iconName: "image-folder-view"
115
                onClicked: foldersViewClicked()
116 117

                hoverEnabled: !isMobile
118 119 120
                ToolTip.delay: 1000
                ToolTip.timeout: 5000
                ToolTip.visible: hovered
121
                ToolTip.text: qsTr("Folders")
122
            }
123 124 125 126 127 128
        }

        Item
        {
            Layout.fillWidth: true
            Layout.fillHeight: true
129

130
            PixButton
Camilo Higuita's avatar
Camilo Higuita committed
131 132
            {
                id: albumsView
133
                anchors.centerIn: parent
Camilo Higuita's avatar
Camilo Higuita committed
134

135
                iconColor: currentIndex === views.albums? accentColor : textColor
Camilo Higuita's avatar
Camilo Higuita committed
136

137
                iconName: "image-multiple"
Camilo Higuita's avatar
Camilo Higuita committed
138 139
                onClicked: albumsViewClicked()

140
                hoverEnabled: !isMobile
Camilo Higuita's avatar
Camilo Higuita committed
141 142 143 144 145
                ToolTip.delay: 1000
                ToolTip.timeout: 5000
                ToolTip.visible: hovered
                ToolTip.text: qsTr("Albums")
            }
146
        }
Camilo Higuita's avatar
Camilo Higuita committed
147

148 149 150 151
        Item
        {
            Layout.fillWidth: true
            Layout.fillHeight: true
152

153
            PixButton
Camilo Higuita's avatar
Camilo Higuita committed
154 155
            {
                id: tagsView
156
                anchors.centerIn: parent
Camilo Higuita's avatar
Camilo Higuita committed
157

158
                iconColor: currentIndex === views.tags? accentColor : textColor
Camilo Higuita's avatar
Camilo Higuita committed
159

160
                iconName: "tag"
Camilo Higuita's avatar
Camilo Higuita committed
161
                onClicked: tagsViewClicked()
162 163

                hoverEnabled: !isMobile
Camilo Higuita's avatar
Camilo Higuita committed
164 165 166 167 168
                ToolTip.delay: 1000
                ToolTip.timeout: 5000
                ToolTip.visible: hovered
                ToolTip.text: qsTr("Tags")
            }
169
        }
170
        Item { Layout.fillWidth: true }
Camilo Higuita's avatar
Camilo Higuita committed
171

172
        Item
173 174
        {
            Layout.alignment: Qt.AlignRight
175 176
            Layout.fillWidth: true
            Layout.fillHeight: true
Camilo Higuita's avatar
Camilo Higuita committed
177 178


179 180 181 182
            PixButton
            {
                id: searchView
                anchors.centerIn: parent
Camilo Higuita's avatar
Camilo Higuita committed
183

184
                iconColor: currentIndex === views.search? accentColor : textColor
Camilo Higuita's avatar
Camilo Higuita committed
185

186 187
                iconName: "edit-find"
                onClicked: searchViewClicked()
Camilo Higuita's avatar
Camilo Higuita committed
188

189
                hoverEnabled: !isMobile
Camilo Higuita's avatar
Camilo Higuita committed
190 191 192
                ToolTip.delay: 1000
                ToolTip.timeout: 5000
                ToolTip.visible: hovered
193
                ToolTip.text: qsTr("Search")
Camilo Higuita's avatar
Camilo Higuita committed
194 195 196 197 198
            }
        }
    }
}