5 property alias textInButton: buttonText.text
6 property bool checkable: false
7 property bool checked: false
15 function setText(string) { textInButton = qsTr(string); }
16 function press() { mouseArea.pressed }
18 Keys.onReturnPressed: {
21 button.checked=!button.checked;
28 anchors.centerIn: parent;
30 height: parent.height;
34 button.checked=!button.checked;
44 anchors.centerIn: parent;
45 horizontalAlignment: Text.AlignHCenter
46 font.pixelSize: parent.height * .5
47 elide: Text.ElideRight;
48 style: Text.Sunken; color: "white"; styleColor: "black"; smooth: true
53 width: (image1.sourceSize.width*parent.height)/image1.sourceSize.height +1
55 anchors.left: parent.left
56 source: "qrc:/button/buttonLeft.png"
58 fillMode:Image.Stretch
65 anchors.right: image2.left
66 anchors.rightMargin: -1
67 anchors.left: image1.right
68 anchors.leftMargin: -1
69 source: "qrc:/button/buttonCenter.png"
70 //fillMode:Image.Stretch
71 fillMode: Image.TileHorizontally
78 width: (image1.sourceSize.width*parent.height)/image1.sourceSize.height +1
80 anchors.right: parent.right
81 source: "qrc:/button/buttonR.png"
82 fillMode:Image.Stretch
88 when: ((button.enabled) && (mouseArea.pressed || (button.checkable && button.checked) ) )
90 PropertyChanges { target: image1; source: "qrc:/button/buttonLeftPushed.png" }
91 PropertyChanges { target: image3; source: "qrc:/button/buttonCenterPushed.png" }
92 PropertyChanges { target: image2; source: "qrc:/button/buttonRightPushed.png" }
96 when: (button.enabled == false);
98 PropertyChanges { target: image1; source: "qrc:/button/buttonLeftDisabled.png" }
99 PropertyChanges { target: image3; source: "qrc:/button/buttonCenterDisabled.png" }
100 PropertyChanges { target: image2; source: "qrc:/button/buttonRightDisabled.png" }
104 when: (button.enabled && !mouseArea.pressed && button.focus)
106 PropertyChanges { target: image1; source: "qrc:/button/buttonLeftFocus.png" }
107 PropertyChanges { target: image3; source: "qrc:/button/buttonCenterFocus.png" }
108 PropertyChanges { target: image2; source: "qrc:/button/buttonRFocus.png" }