Replaced self made UI rotation with system's rotation, portrait panels need some...
[situare] / src / qmlui / PanelSelectorButton.qml
1 import Qt 4.7
2
3 Rectangle {
4     id: button
5     property alias image: image.source
6     property alias text: text.text
7
8     property bool autoRotationEnabled: true
9
10     signal buttonClicked()
11     color: "#222222"
12     width: Math.min(parent.width, parent.height)
13     height: width
14
15     MouseArea {
16         id: mouseArea
17         anchors.fill: parent
18         onClicked: buttonClicked()
19     }
20
21     Image {
22         id: image
23         smooth: true
24         anchors.centerIn: parent
25         anchors.verticalCenterOffset: -6
26         width: sourceSize.width
27         height: sourceSize.height
28     }
29
30     Text {
31         id: text
32         color: "#aaaaaa"
33         font.pixelSize: 18
34         smooth: true
35         anchors.bottom: parent.bottom
36         anchors.bottomMargin: 8
37         anchors.horizontalCenter: parent.horizontalCenter
38     }
39
40     states: [
41         State {
42             name: "highlight"
43             when: mouseArea.pressed
44             PropertyChanges {
45                 target: button
46                 color: palette.highlight
47             }
48         }
49     ]
50 }