Merge branch 'develop'
[lichviet] / qml / LichViet / Button.qml
index c1a24d7..d8138bc 100644 (file)
@@ -15,53 +15,46 @@ You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>
 */
 
-import QtQuick 1.0
+import QtQuick 1.1
 
 Item {
     id: container
 
     signal clicked
-
+    
     property string text
-    property bool keyUsing: false
-
-    BorderImage {
-        id: buttonImage
-        source:  theme_manager.theme.toolbar.button_sci
-        width: container.width; height: container.height
-    }
-    BorderImage {
-        id: pressed
-        opacity: 0
-        source: theme_manager.theme.toolbar.button_pressed_sci
-        width: container.width; height: container.height
-    }
-    MouseArea {
-        id: mouseRegion
-        anchors.fill: buttonImage
-        onClicked: { container.clicked(); }
-    }
-    Text {
-        id: btnText
-        color: if(container.keyUsing){"#D0D0D0";} else {"#FFFFFF";}
-        anchors.centerIn: buttonImage; font.bold: true
-        text: container.text; style: Text.Raised; styleColor: "black"
-        font.pixelSize: 24
-        font.family: "Tahoma"
-    }
-    states: [
-        State {
-            name: "Pressed"
-            when: mouseRegion.pressed == true
-            PropertyChanges { target: pressed; opacity: 1 }
-        },
-        State {
-            name: "Focused"
-            when: container.activeFocus == true
-            PropertyChanges { target: btnText; color: "#FFFFFF" }
+    
+    Rectangle {
+        anchors.fill: parent
+        y:parent.y
+        width:parent.width
+        height:parent.height
+        
+        radius: 4
+        border.color: "grey"
+        
+        Text {
+            id: button1
+            color: "#000000"
+            anchors.centerIn: parent; font.bold: true
+            text: container.text; style: Text.Raised; styleColor: "black"
+            font.pixelSize: 22
+            font.family: "Tahoma"
+            }
+        
+        MouseArea {
+            id: mouseRegion
+            anchors.fill: parent
+            onClicked: { container.clicked(); }
+            
+            onPressed: {
+                parent.color = "blue"
+                }
+            
+            onReleased: {
+                parent.color = "white"
+                }
+            }
         }
-    ]
-    transitions: Transition {
-        ColorAnimation { target: btnText; }
+    
     }
-}