Fix button graphics when button was pressed or disabled. Add disabled state to button...
[mdictionary] / src / mdictionary / qml / IconButton.qml
index 9b66836..7fc32ea 100644 (file)
@@ -58,37 +58,21 @@ Rectangle {
         source: "qrc:/button/buttonR.png"
     }
 
-    Rectangle {
-        id: shade
-        z: 4
-        anchors.centerIn: parent;
-        color: "black";
-        radius: 20;
-        opacity: 1;
-        width:  rectangle.width;
-        height: rectangle.height;
-    }
 
     states: [
         State {
-            name: "enable";
-            when: (mouseArea.pressed == false && rectangle.enabled == true);
-            PropertyChanges { target: shade;
-                              opacity: 0; }
-        },
-        State {
             name: "disable";
             when: (rectangle.enabled == false);
-            PropertyChanges { target: shade;
-                              color: "black";
-                              opacity: .5; }
+            PropertyChanges { target: image1; source: "qrc:/button/buttonLeftDisabled.png" }
+            PropertyChanges { target: image3; source: "qrc:/button/buttonCenterDisabled.png" }
+            PropertyChanges { target: image2; source: "qrc:/button/buttonRightDisabled.png" }
         },
         State {
             name: "clicked";
             when: (mouseArea.pressed == true && rectangle.enabled == true);
-            PropertyChanges { target: shade;
-                              color: "#fffead"
-                              opacity: 0.5; }
+            PropertyChanges { target: image1; source: "qrc:/button/buttonLeftPushed.png" }
+            PropertyChanges { target: image3; source: "qrc:/button/buttonCenterPushed.png" }
+            PropertyChanges { target: image2; source: "qrc:/button/buttonRightPushed.png" }
         }
     ]
 }