Merge branch 'develop'
[lichviet] / qml / DatePicker / component / DateReel.qml
index 8ae694b..bc4d49b 100644 (file)
@@ -1,4 +1,6 @@
-import QtQuick 1.0
+import QtQuick 1.1
+
+import "../../LichViet/main.js" as Script
 
 Item {
     id: container
@@ -19,18 +21,6 @@ Item {
     // Spacing between items
     property int spacing: 8
 
-    property Component itemBackground: Component {
-        BorderImage {
-            border { top: 8; bottom: 8; left: 8; right: 8 }
-            source:  theme_manager.theme.datepicker.button
-        }
-    }
-    property Component itemBackgroundPressed: Component {
-        BorderImage {
-            border { top: 8; bottom: 8; left: 8; right: 8 }
-            source: theme_manager.theme.datepicker.button_pressed
-        }
-    }
 
     width: 240
     height:  90
@@ -47,8 +37,6 @@ Item {
             fontColor: container.fontColor
             fontName: container.fontName
             fontSize: container.fontSize
-            bg: itemBackground
-            bgPressed: itemBackgroundPressed
              opacity: (index+1 < days.start || index+1 > days.end) ? 0.5 : 1.0
         }
     }
@@ -62,8 +50,6 @@ Item {
             fontColor: container.fontColor
             fontName: container.fontName
             fontSize: container.fontSize
-            bg: itemBackground
-            bgPressed: itemBackgroundPressed
 
         }
     }
@@ -77,8 +63,6 @@ Item {
             fontColor: container.fontColor
             fontName: container.fontName
             fontSize: container.fontSize
-            bg: itemBackground
-            bgPressed: itemBackgroundPressed
         }
     }
 
@@ -149,12 +133,12 @@ Item {
 
         Component.onCompleted: {
             appends()
-            day.index = screen.curDay - 1
-            end = LC.calDays(month.index+1,year.index+1900);
+            day.index = Script.curDay - 1
+            end = Script.calDaysX(month.index+1,year.index+1900);
         }
 
         function reset(){
-            var howmanydays =  LC.calDays(month.index+1,year.index+1900);
+            var howmanydays =  Script.calDaysX(month.index+1,year.index+1900);
             end = howmanydays;
 
             if (day.index+1 < days.start) day.index = days.start-1;
@@ -171,7 +155,7 @@ Item {
         }
 
         function change(){
-           day.index = screen.curDay-1;
+           day.index = Script.curDay-1;
         }
     }
 
@@ -184,11 +168,11 @@ Item {
                 else
                    append({number:j})
             }
-            month.index = screen.curMonth - 1
+            month.index = Script.curMonth - 1
         }
 
         function change(){
-             month.index = screen.curMonth - 1;
+             month.index = Script.curMonth - 1;
         }
     }
 
@@ -198,26 +182,26 @@ Item {
             for(var i=1900;i<2099;i++){
                 append({number:i})
             }
-            year.index = screen.curYear - 1900
+            year.index = Script.curYear - 1900
         }
 
         function change(){
-              year.index = screen.curYear - 1900
+              year.index = Script.curYear - 1900
         }
     }
 
     function day_reset(){
-         datePicker.mDay = screen.curDay
+         datePicker.mDay = Script.curDay
         days.change()
     }
 
     function month_reset(){
-                 datePicker.mMonth = screen.curMonth
+                 datePicker.mMonth = Script.curMonth
         months.change()
     }
 
     function year_reset(){
-        datePicker.mYear = screen.curYear
+        datePicker.mYear = Script.curYear
         years.change()
     }