summaryrefslogtreecommitdiffstats
path: root/examples/charts/qmloscilloscope/qml/qmloscilloscope/MultiButton.qml
diff options
context:
space:
mode:
Diffstat (limited to 'examples/charts/qmloscilloscope/qml/qmloscilloscope/MultiButton.qml')
-rw-r--r--examples/charts/qmloscilloscope/qml/qmloscilloscope/MultiButton.qml53
1 files changed, 32 insertions, 21 deletions
diff --git a/examples/charts/qmloscilloscope/qml/qmloscilloscope/MultiButton.qml b/examples/charts/qmloscilloscope/qml/qmloscilloscope/MultiButton.qml
index 8eb6eb67..79322a29 100644
--- a/examples/charts/qmloscilloscope/qml/qmloscilloscope/MultiButton.qml
+++ b/examples/charts/qmloscilloscope/qml/qmloscilloscope/MultiButton.qml
@@ -27,9 +27,7 @@
**
****************************************************************************/
-import QtQuick 2.0
-import QtQuick.Controls 1.0
-import QtQuick.Controls.Styles 1.0
+import QtQuick
Item {
id: button
@@ -44,26 +42,39 @@ Item {
implicitWidth: buttonText.implicitWidth + 5
implicitHeight: buttonText.implicitHeight + 10
- Button {
- id: buttonText
- width: parent.width
- height: parent.height
+ Rectangle {
+ anchors.fill: parent
+ radius: 3
+ gradient: button.enabled ? enabledGradient : disabledGradient
- style: ButtonStyle {
- label: Component {
- Text {
- text: button.text + button.items[currentSelection]
- clip: true
- wrapMode: Text.WordWrap
- verticalAlignment: Text.AlignVCenter
- horizontalAlignment: Text.AlignHCenter
- anchors.fill: parent
- }
- }
+ Gradient {
+ id: enabledGradient
+ GradientStop { position: 0.0; color: "#eeeeee" }
+ GradientStop { position: 1.0; color: "#cccccc" }
+ }
+ Gradient {
+ id: disabledGradient
+ GradientStop { position: 0.0; color: "#444444" }
+ GradientStop { position: 1.0; color: "#666666" }
+ }
+
+ Text {
+ id: buttonText
+ text: button.text + button.items[currentSelection]
+ clip: true
+ wrapMode: Text.WordWrap
+ verticalAlignment: Text.AlignVCenter
+ horizontalAlignment: Text.AlignHCenter
+ anchors.fill: parent
+ font.pointSize: 14
}
- onClicked: {
- currentSelection = (currentSelection + 1) % items.length;
- selectionChanged(button.items[currentSelection]);
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ currentSelection = (currentSelection + 1) % items.length;
+ selectionChanged(button.items[currentSelection]);
+ }
}
}
}