Added global controller andalso filebrowser qml
[lichviet] / qml / LichViet / FullMonth.qml
index 117aaee..331b3f7 100644 (file)
@@ -3,7 +3,7 @@ Copyright (C) 2011  by Cuong Le <metacuong@gmail.com>
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
+the Free Software Foundation, either version 2 of the License, or
 (at your option) any later version.
 
 This program is distributed in the hope that it will be useful,
@@ -17,7 +17,11 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>
 
 import QtQuick 1.0
 import "../DatePicker/component" as Comp
+
 import "amlich-hnd.js" as AmLich
+import "amlich-aa98.js" as AmLich98
+
+import "CacNgayLeTrongNam.js" as CNLTN
 
 Item{
     id: item1
@@ -25,7 +29,6 @@ Item{
     Rectangle{
         id: fullmonthREC
         anchors.fill: parent; anchors.bottomMargin: 0
-        visible: true
         opacity:0.9
 
             Component {
@@ -41,8 +44,13 @@ Item{
                         Text { color: {
                                 if (header)
                                   return  "#000000";
-                                else
-                                    return "#007070"
+                                else{
+                                    var stemp = AmLich98.convertSolar2Lunar(txtDATEpv.currentIndex+1,curMonth,curYear,7);
+                                    if (CNLTN.is_holiday(day, month, stemp[0], stemp[1]))
+                                        return theme_manager.theme.markdate.holidays;
+                                    else
+                                        return "#007070"
+                                }
                             }
 
                             text: name; anchors.horizontalCenter: parent.horizontalCenter
@@ -116,14 +124,8 @@ onCanceled:{
                 id: grid
                 x: -335
                 y: 41
-                width: {
-                    800
-                }
-
-                height: {
-                    480
-                }
-
+                width:800
+                height: 480
                 anchors.horizontalCenterOffset: 15
                 anchors.bottomMargin: -52
                 anchors.topMargin: 42
@@ -197,10 +199,6 @@ onCanceled:{
         }
     }
 
-    transitions: [
-        Transition { NumberAnimation { properties: "x,y,opacity"; duration: 500; easing.type: Easing.InOutBack } }
-    ]
-
     states: [
         State {
             name: "xemtheothang"
@@ -264,40 +262,41 @@ onCanceled:{
         var prevmonth = get_prevmonth(startfrom)
 
         var dayclick, monthclick, yearclick;
-        console.log(lmodel.count)
 
         while(lmodel.count>7){
             lmodel.remove(lmodel.count-1);
         }
 
+        var datas1,datas,lunarclmonth,inmonths;
+
         for (var i=7;i<49;i++){
             var realnumber = i - 7;
             if (realnumber >= startfrom && j<= daysofthemonthyear){
             var lunarcl = AmLich.getLunarDate(j,screen.curMonth,screen.curYear)
             if (lunarcl.day==1){
-                var lunarclmonth = "/"+lunarcl.month
+                lunarclmonth = "/"+lunarcl.month
             }else{
-                var lunarclmonth = ""
+                lunarclmonth = ""
             }
 
-            var datas = j+"<br><span style='font-size:18px;float:right;color:#700070;'>&nbsp;&nbsp;"+lunarcl.day+lunarclmonth+"</span>";
+            datas = j+"<br><span style='font-size:18px;float:right;color:#700070;'>&nbsp;&nbsp;"+lunarcl.day+lunarclmonth+"</span>";
             dayclick = j;
             monthclick = screen.curMonth;
             yearclick = screen.curYear;
-            var inmonths = true;
+            inmonths = true;
                 j++;
             }else{
                 if (realnumber<startfrom){
-                    var datas1= prevmonth[realnumber];
+                    datas1= prevmonth[realnumber];
                 }else
                 {
-                    var datas1=nextmonth[(totalslot-realnumber)-1];
+                    datas1=nextmonth[(totalslot-realnumber)-1];
                 }
                 dayclick = datas1.duong;
                 monthclick = datas1.month;
                 yearclick = datas1.year;
-                var datas = "<span style='color:grey;font-weight:normal;'>"+datas1.duong+"</span><br><span style='font-size:18px;float:right;color:#CCFFFF;'>&nbsp;&nbsp;"+datas1.am+"</span>";
-                var inmonths=false;
+                datas = "<span style='color:grey;font-weight:normal;'>"+datas1.duong+"</span><br><span style='font-size:18px;float:right;color:#CCFFFF;'>&nbsp;&nbsp;"+datas1.am+"</span>";
+                inmonths=false;
             }
 
             lmodel.append({header:false,name:datas,inmonth:inmonths,day:dayclick,month:monthclick,year:yearclick})