From 00885c1ddd04819c44d6a0ca2c7f2af8a1298a97 Mon Sep 17 00:00:00 2001 From: Lars Uebernickel Date: Tue, 4 Jun 2013 21:05:40 -0400 Subject: unitymenumodel: expose isSeparator --- examples/unityqmlmenumodel.qml | 37 +++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) (limited to 'examples') diff --git a/examples/unityqmlmenumodel.qml b/examples/unityqmlmenumodel.qml index 257866d..d38d6e5 100644 --- a/examples/unityqmlmenumodel.qml +++ b/examples/unityqmlmenumodel.qml @@ -18,16 +18,33 @@ Item { anchors.margins: 10 spacing: 3 model: menu - delegate: Rectangle { - width: parent.width - height: 40 - color: "#ddd" - Text { - anchors.fill: parent - anchors.margins: 5 - verticalAlignment: Text.AlignVCenter - color: sensitive ? "black" : "#aaa"; - text: label + + delegate: Loader { + sourceComponent: isSeparator ? separator : menuitem; + + Component { + id: separator + Rectangle { + width: parent.width + height: 4 + color: "blue" + } + } + + Component { + id: menuitem + Rectangle { + width: parent.width + height: 40 + color: "#ddd" + Text { + anchors.fill: parent + anchors.margins: 5 + verticalAlignment: Text.AlignVCenter + color: sensitive ? "black" : "#aaa"; + text: label + } + } } } } -- cgit v1.2.3