improved desktop UI
[mardrone] / mardrone / ardrone_android.qml
index c035488..4e24d26 100644 (file)
@@ -13,15 +13,6 @@ PageStackWindow {
     property Component dialogComponent
 // property alias m: mainPage
 
-    /*
-    ToolBarLayout {
-            id: commonTools
-            visible: false
-            ToolItem { iconId: "icon-m-toolbar-back"; onClicked: pageStack.pop(); }
-        //    ToolItem { iconId: "icon-m-toolbar-home"; onClicked: pageStack.pop(); }
-            ToolItem { iconId: "icon-m-toolbar-view-menu"; onClicked: myMenu.open(); }
-        }
-        */
     ToolBarLayout {
         id: commonTools
         ToolButton {
@@ -41,6 +32,30 @@ PageStackWindow {
       onRudderChanged:  {if(drone.confUseJoyStick) drone.yaw=rudder;}
 
   }
+  Keys.onUpPressed: {
+                console.debug("QML:Keys.onUpPressed",event.key)
+                if (event.key == Qt.Key_TopMenu)
+                    console.debug("QML: opening menu!")
+                else if (event.key == Qt.Key_MediaPrevious) {
+                    console.debug("QML: closing! (maybe)")
+                    pageStack.depth <= 1 ? Qt.quit() : pageStack.pop()
+                }
+            }
+  Keys.onPressed: {
+                console.debug("QML:Keys.onPressed",event.key)
+                if (event.key == Qt.Key_TopMenu)
+                    console.debug("QML: opening menu!")
+                else if (event.key == Qt.Key_MediaPrevious) {
+                    console.debug("QML: closing! (maybe)")
+                    pageStack.depth <= 1 ? Qt.quit() : pageStack.pop()
+                }
+            }
+
+  function backKey() {
+       console.debug("QML: backKey")
+      pageStack.depth <= 1 ? Qt.quit() : pageStack.pop()
+    }
+
 
     Component {
       id: mainpageComponent
@@ -219,7 +234,7 @@ PageStackWindow {
 
         Button {
             x:400
-            width:60
+            width:80
             height:50
             id:flyButton
             anchors.bottom:parent.bottom
@@ -232,7 +247,7 @@ PageStackWindow {
         }
         Button {
             x:500;
-            width:80
+            width:90
             height:50
             id:emergencyButton
             anchors.bottom:parent.bottom