qmlFrontend/qml/qmlFrontend/HWButton.qml
branchqmlfrontend
changeset 10422 4cf23d4c7624
parent 10402 3313336c1ee0
child 11787 bcba7938ccb5
--- a/qmlFrontend/qml/qmlFrontend/HWButton.qml	Mon Sep 22 02:10:39 2014 +0400
+++ b/qmlFrontend/qml/qmlFrontend/HWButton.qml	Fri Sep 26 00:56:36 2014 +0400
@@ -7,17 +7,36 @@
     color: "#15193a"
     radius: 8
     border.width: 4
-    border.color: "#ea761d"
     opacity: 1
 
     signal clicked()
 
+    Behavior on border.color {
+        ColorAnimation {}
+    }
+
     MouseArea {
         id: mousearea
         anchors.fill: parent
         hoverEnabled: true
-        onEntered: parent.border.color = "#eaea00"
-        onExited: parent.border.color = "#ea761d"
-        onClicked: hwbutton.clicked()
+        onClicked: parent.clicked()
     }
+
+    states: [
+        State {
+            when: mousearea.containsMouse
+
+            PropertyChanges {
+                target: hwbutton
+                border.color: "#eaea00"
+            }
+        }
+        , State {
+            when: !mousearea.containsMouse
+
+            PropertyChanges {
+                target: hwbutton
+                border.color: "#ea761d"
+            }
+    }]
 }