* Improved QML/JS.
[lichviet] / qml / LichViet / About.qml
index c8cdd66..bc11951 100644 (file)
@@ -16,8 +16,34 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>
 */
 import QtQuick 1.0
 
+import "Themes.js" as Themes
+
 Item{
-    id: item1
+
+    id: aboutdlg
+
+    anchors.verticalCenter: parent.verticalCenter
+    width: parent.width; height: parent.height;
+    x:(parent.width * 1.5)
+
+    signal close
+
+    Loader {
+        id: theme_manager
+        property alias theme: theme_manager.item
+        source: Themes.default_theme()
+    }
+
+    Connections {
+        target: aboutdlg.parent
+
+        onDialogClose: {
+            aboutdlg.state = "close";
+            aboutdlg.destroy(600);
+        }
+    }
+
+
     Rectangle {
         id: rectangle1
         anchors.fill: parent; anchors.bottomMargin: 0
@@ -83,14 +109,46 @@ wrapMode: Text.NoWrap
 
 }
 
-    ToolBarSingle { id: toolBar; height: 50;
-        y: screen.height-78
+    Rectangle {
+        width : aboutdlg.width
+        height: 45
+        color:"white"
+        opacity: 0.5
+    }
+
+    Text {
+        id: title
+
+        anchors { horizontalCenter: aboutdlg.horizontalCenter; top: aboutdlg.top; topMargin: 10 }
+        font.pixelSize: 22
+        color: "black"
+        text: qsTr("About")
+        smooth: true
+        font.bold: true
+    }
+
+
+    ToolBarSingle {
+        id: toolBar; height: 42;
+        y: parent.height-52
         width: parent.width;
         button1Label: "Quay Về"
-        onButton1Clicked:
-        {
-            screen.state="mainscreen"
+        onButton1Clicked:aboutdlg.close()
+    }
+
+    states: [
+        State {
+            name: "show"
+            AnchorChanges { target: aboutdlg; anchors.right: parent.right }
+        },
+        State {
+            name: "close"
+            AnchorChanges { target: aboutdlg; anchors.right: parent.left }
         }
+    ]
+
+    transitions: Transition {
+        AnchorAnimation { easing.type: Easing.OutQuart; duration: 300 }
     }
 
 }