diff options
Diffstat (limited to 'navit/gui/qml/skins/navit/ButtonIcon.qml')
-rw-r--r-- | navit/gui/qml/skins/navit/ButtonIcon.qml | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/navit/gui/qml/skins/navit/ButtonIcon.qml b/navit/gui/qml/skins/navit/ButtonIcon.qml index f969ebb5a..9b5d6ae3a 100644 --- a/navit/gui/qml/skins/navit/ButtonIcon.qml +++ b/navit/gui/qml/skins/navit/ButtonIcon.qml @@ -1,40 +1,40 @@ -import Qt 4.7
-
-Rectangle {
+import Qt 4.7 + +Rectangle { id: container -
- signal clicked
- property string text: "Button"
- property string icon: "Icon.png"
-
- color: "black"; smooth: true; opacity: 0.75
- width: imgItem.width+20; height: txtItem.height + 6 + imgItem.height;
- transformOrigin: Rectangle.Center;
-
- MouseArea { id: mr; anchors.fill: parent; onClicked: container.clicked() }
-
- Image {
- id: imgItem; source: gui.iconPath+container.icon; anchors.top: container.top; anchors.horizontalCenter: container.horizontalCenter;
- width: gui.height/4; height: gui.height/4
- }
-
- Text {
- id: txtItem; text: container.text; anchors.top: imgItem.bottom; anchors.horizontalCenter: container.horizontalCenter;
- color: "White"; font.pointSize: gui.height/32; horizontalAlignment: Qt.AlignHCenter
- }
-
- states: [
- State {
- name: "Pressed"; when: mr.pressed == true
- PropertyChanges { target: container; scale: 2.0 }
- PropertyChanges { target: container; opacity: 1 }
-
- }
- ]
-
- transitions: Transition {
- NumberAnimation { properties: "scale"; easing.type: "OutExpo"; duration: 200 }
- NumberAnimation { properties: "opacity"; easing.type: "InQuad"; duration: 200 }
- }
-
-}
+ + signal clicked + property string text: "Button" + property string icon: "Icon.png" + + color: "black"; smooth: true; opacity: 0.75 + width: imgItem.width+20; height: txtItem.height + 6 + imgItem.height; + transformOrigin: Rectangle.Center; + + MouseArea { id: mr; anchors.fill: parent; onClicked: container.clicked() } + + Image { + id: imgItem; source: gui.iconPath+container.icon; anchors.top: container.top; anchors.horizontalCenter: container.horizontalCenter; + width: gui.height/4; height: gui.height/4 + } + + Text { + id: txtItem; text: container.text; anchors.top: imgItem.bottom; anchors.horizontalCenter: container.horizontalCenter; + color: "White"; font.pointSize: gui.height/32; horizontalAlignment: Qt.AlignHCenter + } + + states: [ + State { + name: "Pressed"; when: mr.pressed == true + PropertyChanges { target: container; scale: 2.0 } + PropertyChanges { target: container; opacity: 1 } + + } + ] + + transitions: Transition { + NumberAnimation { properties: "scale"; easing.type: "OutExpo"; duration: 200 } + NumberAnimation { properties: "opacity"; easing.type: "InQuad"; duration: 200 } + } + +} |