summaryrefslogtreecommitdiffstats
path: root/qt-mobile
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2016-01-04 13:01:42 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-01-04 13:02:46 -0800
commitc53aa7dbfbb615e0aea28a414672882a86468cb3 (patch)
tree8cef77b682c7ba28be83c2507120f5f3ed92b14c /qt-mobile
parent7cc851ebad3a9cef5a1238197754903f1c9ed9e4 (diff)
downloadsubsurface-c53aa7dbfbb615e0aea28a414672882a86468cb3.tar.gz
QML UI: add context menu button
Right now this is an alternative to the magic action button - but the goal is to replace it completely. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-mobile')
-rw-r--r--qt-mobile/qml/TopBar.qml28
-rw-r--r--qt-mobile/qml/icons/context-menu.pngbin0 -> 641 bytes
-rw-r--r--qt-mobile/qml/icons/context-menu.svg1
-rw-r--r--qt-mobile/qml/mobile-resources.qrc1
4 files changed, 30 insertions, 0 deletions
diff --git a/qt-mobile/qml/TopBar.qml b/qt-mobile/qml/TopBar.qml
index e52909bca..a7630860f 100644
--- a/qt-mobile/qml/TopBar.qml
+++ b/qt-mobile/qml/TopBar.qml
@@ -80,5 +80,33 @@ Rectangle {
Item {
Layout.fillWidth: true
}
+ 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"
+ width: MobileComponents.Units.gridUnit
+ 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()
+ }
+ }
+ }
+
}
}
diff --git a/qt-mobile/qml/icons/context-menu.png b/qt-mobile/qml/icons/context-menu.png
new file mode 100644
index 000000000..df34cfd4f
--- /dev/null
+++ b/qt-mobile/qml/icons/context-menu.png
Binary files differ
diff --git a/qt-mobile/qml/icons/context-menu.svg b/qt-mobile/qml/icons/context-menu.svg
new file mode 100644
index 000000000..e0750c57e
--- /dev/null
+++ b/qt-mobile/qml/icons/context-menu.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M24 16c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 4c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 12c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4z"/></svg> \ No newline at end of file
diff --git a/qt-mobile/qml/mobile-resources.qrc b/qt-mobile/qml/mobile-resources.qrc
index 24b88676f..8d799f09f 100644
--- a/qt-mobile/qml/mobile-resources.qrc
+++ b/qt-mobile/qml/mobile-resources.qrc
@@ -16,6 +16,7 @@
<file>dive.jpg</file>
<file alias="subsurface-mobile-icon.png">../../icons/subsurface-mobile-icon.png</file>
<file alias="main-menu.png">icons/main-menu.png</file>
+ <file alias="context-menu.png">icons/context-menu.png</file>
</qresource>
<qresource prefix="/imports">
<file alias="org/kde/plasma/mobilecomponents/qmldir">mobilecomponents/qmldir</file>