diff options
Diffstat (limited to 'demos/declarative/calculator/CalcButton.qml')
-rw-r--r-- | demos/declarative/calculator/CalcButton.qml | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/demos/declarative/calculator/CalcButton.qml b/demos/declarative/calculator/CalcButton.qml deleted file mode 100644 index a125346..0000000 --- a/demos/declarative/calculator/CalcButton.qml +++ /dev/null @@ -1,41 +0,0 @@ -import Qt 4.7 - -Rectangle { - property alias operation: label.text - property bool toggable: false - property bool toggled: false - signal clicked - - id: button; width: 50; height: 30 - border.color: palette.mid; radius: 6 - gradient: Gradient { - GradientStop { id: gradientStop1; position: 0.0; color: Qt.lighter(palette.button) } - GradientStop { id: gradientStop2; position: 1.0; color: palette.button } - } - - Text { id: label; anchors.centerIn: parent; color: palette.buttonText } - - MouseArea { - id: clickRegion - anchors.fill: parent - onClicked: { - doOp(operation); - button.clicked(); - if (!button.toggable) return; - button.toggled ? button.toggled = false : button.toggled = true - } - } - - states: [ - State { - name: "Pressed"; when: clickRegion.pressed == true - PropertyChanges { target: gradientStop1; color: palette.dark } - PropertyChanges { target: gradientStop2; color: palette.button } - }, - State { - name: "Toggled"; when: button.toggled == true - PropertyChanges { target: gradientStop1; color: palette.dark } - PropertyChanges { target: gradientStop2; color: palette.button } - } - ] -} |