summaryrefslogtreecommitdiffstats
path: root/examples/declarative/listview/content/MediaButton.qml
blob: c92305a63b1d00cb4f5aa34dfa4b70aca550c014 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<Item id="Container">
    <signals>
        <Signal name="clicked"/>
    </signals>

    <properties>
        <Property name="text"/>
    </properties>

    <Image id="Image" src="pics/button.png"/>
    <Image id="Pressed" src="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>