Changeset View
Changeset View
Standalone View
Standalone View
cuttlefish/package/contents/ui/GlobalMenuBar.qml
- This file was copied from cuttlefish/package/contents/ui/IconGrid.qml.
1 | import QtQuick 2.5 | ||||
---|---|---|---|---|---|
2 | import Qt.labs.platform 1.0 | ||||
3 | | ||||
1 | /*************************************************************************** | 4 | /*************************************************************************** | ||
2 | * * | 5 | * * | ||
3 | * Copyright 2014-2015 Sebastian Kügler <sebas@kde.org> * | 6 | * Copyright 2019 Carson Black <uhhadd@gmail.com> * | ||
4 | * * | 7 | * * | ||
5 | * This program is free software; you can redistribute it and/or modify * | 8 | * This program is free software; you can redistribute it and/or modify * | ||
6 | * it under the terms of the GNU General Public License as published by * | 9 | * it under the terms of the GNU General Public License as published by * | ||
7 | * the Free Software Foundation; either version 2 of the License, or * | 10 | * the Free Software Foundation; either version 2 of the License, or * | ||
8 | * (at your option) any later version. * | 11 | * (at your option) any later version. * | ||
9 | * * | 12 | * * | ||
10 | * This program is distributed in the hope that it will be useful, * | 13 | * This program is distributed in the hope that it will be useful, * | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * | 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | ||
13 | * GNU General Public License for more details. * | 16 | * GNU General Public License for more details. * | ||
14 | * * | 17 | * * | ||
15 | * You should have received a copy of the GNU General Public License * | 18 | * You should have received a copy of the GNU General Public License * | ||
16 | * along with this program; if not, write to the * | 19 | * along with this program; if not, write to the * | ||
17 | * Free Software Foundation, Inc., * | 20 | * Free Software Foundation, Inc., * | ||
18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * | 21 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * | ||
19 | * * | 22 | * * | ||
20 | ***************************************************************************/ | 23 | ***************************************************************************/ | ||
21 | 24 | | |||
22 | import QtQuick 2.2 | 25 | MenuBar { | ||
23 | // import QtQuick.Controls 1.0 | 26 | id: root | ||
24 | import QtQuick.Layouts 1.0 | | |||
25 | | ||||
26 | import org.kde.plasma.core 2.0 as PlasmaCore | | |||
27 | import org.kde.plasma.components 2.0 as PlasmaComponents | | |||
28 | import org.kde.plasma.extras 2.0 as PlasmaExtras | | |||
29 | | ||||
30 | | ||||
31 | GridView { | | |||
32 | id: iconGrid | | |||
33 | | ||||
34 | focus: true | | |||
35 | 27 | | |||
36 | cellWidth: iconSize + units.gridUnit | 28 | signal quit() | ||
37 | cellHeight: cellWidth + Math.round(units.gridUnit * 2) | 29 | signal zoomIn() | ||
38 | 30 | signal zoomOut() | |||
39 | cacheBuffer: 10000 | 31 | signal montage(int type) | ||
40 | highlightMoveDuration: 0 | 32 | | ||
41 | boundsBehavior: Flickable.StopAtBounds | 33 | Menu { | ||
42 | model: iconModel | 34 | title: i18n("File") | ||
43 | 35 | Menu { | |||
44 | highlight: Rectangle { | 36 | title: i18n("Export Montage with Color Scheme...") | ||
45 | color: theme.highlightColor | 37 | MenuItem { | ||
46 | //height: parent.height + units.gridUnit * 3 | 38 | text: i18n("Active Color Scheme") | ||
47 | anchors.bottomMargin: -units.gridUnit * 2 | 39 | onTriggered: root.montage(0) | ||
40 | } | ||||
41 | MenuItem { | ||||
42 | text: i18n("Breeze (Normal)") | ||||
43 | onTriggered: root.montage(1) | ||||
44 | } | ||||
45 | MenuItem { | ||||
46 | text: i18n("Breeze Dark") | ||||
47 | onTriggered: root.montage(2) | ||||
48 | } | ||||
49 | MenuItem { | ||||
50 | text: i18n("Breeze (Normal) and Breeze Dark") | ||||
51 | onTriggered: root.montage(0) | ||||
52 | } | ||||
53 | } | ||||
54 | MenuSeparator {} | ||||
55 | MenuItem { | ||||
56 | iconName: "gtk-quit" | ||||
57 | text: i18n("Quit") | ||||
58 | shortcut: StandardKey.Quit | ||||
59 | onTriggered: root.quit() | ||||
60 | } | ||||
61 | } | ||||
62 | Menu { | ||||
63 | title: i18n("View") | ||||
64 | MenuItem { | ||||
65 | iconName: "zoom-in" | ||||
66 | text: i18n("Zoom In") | ||||
67 | shortcut: StandardKey.ZoomIn | ||||
68 | onTriggered: root.zoomIn() | ||||
69 | } | ||||
70 | MenuItem { | ||||
71 | iconName: "zoom-out" | ||||
72 | text: i18n("Zoom Out") | ||||
73 | shortcut: StandardKey.ZoomOut | ||||
74 | onTriggered: root.zoomOut() | ||||
48 | } | 75 | } | ||
49 | | ||||
50 | delegate: IconGridDelegate {} | | |||
51 | | ||||
52 | PlasmaComponents.BusyIndicator { | | |||
53 | running: iconModel.loading | | |||
54 | visible: running | | |||
55 | anchors.centerIn: parent | | |||
56 | width: units.gridUnit * 8 | | |||
57 | height: width | | |||
58 | } | 76 | } | ||
59 | } | 77 | } | ||
78 | No newline at end of file |