From c53aa7dbfbb615e0aea28a414672882a86468cb3 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Mon, 4 Jan 2016 13:01:42 -0800 Subject: [PATCH] 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 --- qt-mobile/qml/TopBar.qml | 28 +++++++++++++++++++++++++++ qt-mobile/qml/icons/context-menu.png | Bin 0 -> 641 bytes qt-mobile/qml/icons/context-menu.svg | 1 + qt-mobile/qml/mobile-resources.qrc | 1 + 4 files changed, 30 insertions(+) create mode 100644 qt-mobile/qml/icons/context-menu.png create mode 100644 qt-mobile/qml/icons/context-menu.svg 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 0000000000000000000000000000000000000000..df34cfd4f67f9109acac2853067b5c3d1db0b40a GIT binary patch literal 641 zcmeAS@N?(olHy`uVBq!ia0vp^2SAvE8Azrw%`pX1lLLH0T!HleK?W{btHuGHWl$32 z7tHYT*U#C?Urx<9&dYIe-s?!tH(hhouJovWeWjwW^gAqqXXdxg=b_w+ZRgqf3@>r% z{nh*MiGhJJ*VDx@q~g}wTkd%*iUJN7oA@Rde|R#-#;^4M(ym!< zrYfb(y+xC()(1*5|JlCI%~H?s{0seUQl-hwUh3?OY)vL{a3)d@TBv3!TCFM zihF \ 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 @@ dive.jpg ../../icons/subsurface-mobile-icon.png icons/main-menu.png + icons/context-menu.png mobilecomponents/qmldir