aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorLars Uebernickel <lars.uebernickel@canonical.com>2013-06-05 13:50:12 -0400
committerLars Uebernickel <lars.uebernickel@canonical.com>2013-06-05 13:50:12 -0400
commite735d95e613e2ee6170799002183e0770d34590e (patch)
treed8f823bb8f17a9db0f4105f0566cf4b862e5476d /examples
parent692926cb12c8f8e6d3969c249dbf924a0bd1499b (diff)
downloadqmenumodel-e735d95e613e2ee6170799002183e0770d34590e.tar.gz
qmenumodel-e735d95e613e2ee6170799002183e0770d34590e.tar.bz2
qmenumodel-e735d95e613e2ee6170799002183e0770d34590e.zip
unitymenumodel: add activate()
Diffstat (limited to 'examples')
-rw-r--r--examples/unityqmlmenumodel.qml9
1 files changed, 7 insertions, 2 deletions
diff --git a/examples/unityqmlmenumodel.qml b/examples/unityqmlmenumodel.qml
index d38d6e5..a66ba8e 100644
--- a/examples/unityqmlmenumodel.qml
+++ b/examples/unityqmlmenumodel.qml
@@ -14,6 +14,7 @@ Item {
}
ListView {
+ id: listview
anchors.fill: parent
anchors.margins: 10
spacing: 3
@@ -25,7 +26,7 @@ Item {
Component {
id: separator
Rectangle {
- width: parent.width
+ width: listview.width
height: 4
color: "blue"
}
@@ -34,7 +35,7 @@ Item {
Component {
id: menuitem
Rectangle {
- width: parent.width
+ width: listview.width
height: 40
color: "#ddd"
Text {
@@ -44,6 +45,10 @@ Item {
color: sensitive ? "black" : "#aaa";
text: label
}
+ MouseArea {
+ anchors.fill: parent
+ onClicked: listview.model.activate(index);
+ }
}
}
}