~ubuntu-branches/ubuntu/precise/navit/precise

« back to all changes in this revision

Viewing changes to navit/gui/qml/skins/navit/ButtonIcon.qml.in

  • Committer: Bazaar Package Importer
  • Author(s): Gilles Filippini
  • Date: 2010-07-27 22:36:40 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20100727223640-jlgmnnwtx2siv1pr
Tags: 0.2.0~svn3501+dfsg.1-1
* New upstream snapshot:
  + Support for autoloaded plugins
  + Many memory leaks fixed
* Refresh patches

* New patch path_max to try fixing the FTBFS on hurd-i386. 

* debian/control: bumped Standards-Version to 3.9.1 (no change needed)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
import Qt 4.6
2
 
 
3
 
Rectangle {
4
 
    id: container
5
 
 
6
 
    signal clicked
7
 
    property string text: "Button"
8
 
    property string icon: "Icon.png"
9
 
 
10
 
    color: "black"; smooth: true; opacity: 0.75
11
 
    width: imgItem.width+20; height: txtItem.height + 6 + imgItem.height;
12
 
    transformOrigin: Rectangle.Center;
13
 
 
14
 
    MouseRegion { id: mr; anchors.fill: parent; onClicked: container.clicked() }
15
 
 
16
 
   Image {
17
 
        id: imgItem; source: gui.iconPath+container.icon; anchors.top: container.top; anchors.horizontalCenter: container.horizontalCenter;
18
 
        width: gui.height/8; height: gui.height/8
19
 
   }
20
 
 
21
 
    Text {
22
 
        id: txtItem; text: container.text; anchors.top: imgItem.bottom; anchors.horizontalCenter: container.horizontalCenter; 
23
 
        color: "White"; font.pointSize: gui.height/32; horizontalAlignment: Qt.AlignHCenter
24
 
    }
25
 
 
26
 
    states: [
27
 
        State {
28
 
            name: "Pressed"; when: mr.pressed == true
29
 
            PropertyChanges { target: container; scale: 2.0 }
30
 
            PropertyChanges { target: container; opacity: 1 }
31
 
 
32
 
        }
33
 
    ]
34
 
 
35
 
    transitions: Transition {
36
 
        NumberAnimation { matchProperties: "scale"; easing: "easeOutExpo"; duration: 200 }
37
 
        NumberAnimation { matchProperties: "opacity"; easing: "easeInQuad"; duration: 200 }
38
 
    }
39
 
 
40
 
}