diff options
-rw-r--r-- | demos/declarative/webbrowser/webbrowser.qml | 1 | ||||
-rw-r--r-- | examples/declarative/listview/content/MediaButton.qml | 61 |
2 files changed, 41 insertions, 21 deletions
diff --git a/demos/declarative/webbrowser/webbrowser.qml b/demos/declarative/webbrowser/webbrowser.qml index 79fd1cd..709d649 100644 --- a/demos/declarative/webbrowser/webbrowser.qml +++ b/demos/declarative/webbrowser/webbrowser.qml @@ -1,4 +1,5 @@ import "content" + Item { id: WebBrowser diff --git a/examples/declarative/listview/content/MediaButton.qml b/examples/declarative/listview/content/MediaButton.qml index 6c672ea..bb2510a 100644 --- a/examples/declarative/listview/content/MediaButton.qml +++ b/examples/declarative/listview/content/MediaButton.qml @@ -1,21 +1,40 @@ -<Item id="Container"> - <signals> - <Signal name="clicked"/> - </signals> - - <properties> - <Property name="text"/> - </properties> - - <Image id="Image" source="pics/button.png"/> - <Image id="Pressed" source="pics/button-pressed.png" opacity="0"/> - <MouseRegion id="MouseRegion" anchors.fill="{Image}" onClicked="Container.clicked.emit();"/> - <Text font.bold="true" color="white" anchors.centeredIn="{Image}" text="{Container.text}"/> - <width>{Image.width}</width> - - <states> - <State name="Pressed" when="{MouseRegion.pressed == true}"> - <SetProperties target="{Pressed}" opacity="1"/> - </State> - </states> -</Item> +Item { + id: Container + signals: Signal { + name: "clicked" + } + properties: Property { + name: "text" + } + Image { + id: Image + source: "pics/button.png" + } + Image { + id: Pressed + source: "pics/button-pressed.png" + opacity: 0 + } + MouseRegion { + id: MouseRegion + anchors.fill: Image + onClicked: { Container.clicked.emit(); } + } + Text { + font.bold: true + color: "white" + anchors.centeredIn: Image + text: Container.text + } + width: Image.width + states: [ + State { + name: "Pressed" + when: MouseRegion.pressed == true + SetProperties { + target: Pressed + opacity: 1 + } + } + ] +} |