along with this program. If not, see <http://www.gnu.org/licenses/>
*/
-import QtQuick 1.0
+import QtQuick 1.1
import "Themes.js" as Themes
import "Settings.js" as Settings
Item {
id: screen
- width: 800
- height: 480
+ width: 480
+ height: 800
state:"mainscreen"
Settings.restore_nomodel();
Script.createDateTimeDialog(screen);
Script.datetimedlg.toolbar.connect(show_toolbar);
+ Script.datetimedlg.updatedate.connect(update_date);
Script.amdatetimedlg.toolbar.connect(show_toolbar);
+ Script.amdatetimedlg.updatedate.connect(update_date);
Script.fullmonth.toolbar.connect(show_toolbar);
Script.fullmonth.updatedate.connect(update_date);
maindatemodel.init();
Script.curMonth = month;
Script.curYear = year;
Script.changeDay(day, txtTHU, txtInfo, txtDAYAmLich);
+ Script.fullmonth.m_day=Script.curDay;
+ Script.fullmonth.m_month=Script.curMonth;
+ Script.fullmonth.m_year=Script.curYear;
+ Script.fullmonth.reset();
}
Rectangle {
state:"jumptodate"
- /*Image {
+ Image {
source: theme_manager.theme.background_image; fillMode: Image.Stretch; anchors.fill: parent
opacity: theme_manager.theme.background_opacity
- }*/
+ }
MouseArea {
onDoubleClicked:{
if (Settings.doubleclicked()==1){
- screen.state="datetimedialog";
-
+ screen.state="switchX";
+ Script.datetimedlg.state="show";
}
}
}
text: name
font.bold: true
font.pixelSize: wrapper.PathView.isCurrentItem ? 80 : 40
- color: "black"
+ color: {
+ if (wrapper.PathView.isCurrentItem){
+ var stemp = Script.convertSolar2Lunar(txtDATEpv.currentIndex+1,curMonth,curYear,7);
+ if (Script.is_holiday(txtDATEpv.currentIndex+1,curMonth, stemp[0], stemp[1])){
+ return theme_manager.theme.markdate.holidays;
+ }else{
+ var mark_day = (Script.getLunarDate(txtDATEpv.currentIndex+1,curMonth,curYear).jd+1)%7;
+ if (mark_day === 0) //sunday
+ return theme_manager.theme.markdate.sunday;
+ if (mark_day == 6) //saturday
+ return theme_manager.theme.markdate.saturday;
+ else
+ return theme_manager.theme.markdate.otherday_selected;
+ }
+ }
+ else
+ return "transparent";//theme_manager.theme.markdate.otherday;
+ }
}
}
}
onMovementEnded: {
Script.changeDay(txtDATEpv.currentIndex+1, txtTHU, txtInfo, txtDAYAmLich);
+ Script.fullmonth.m_day=Script.curDay;
+ Script.fullmonth.m_month=Script.curMonth;
+ Script.fullmonth.m_year=Script.curYear;
+ Script.fullmonth.reset();
}
}
}
Text {
id: txtDMY
- x: 140
+ x: 151
y: 77
- width: 80
height: 20
color: "#29d999"
- textFormat: Text.RichText
text: "Tháng <b>"+screen.curMonth+"</b> Năm <b>"+screen.curYear+"</b>"
+ horizontalAlignment: Text.AlignHCenter
anchors.horizontalCenter: parent.horizontalCenter
font.bold: false
font.family: "Tahoma"
smooth: true
- horizontalAlignment: Text.AlignHCenter
font.pixelSize: 28
}
id: txtTHU
x: 151
y: 210
- width: 80
height: 20
color: "#f0f0f5"
text: Script.__txtTHU_format()
id: txtInfo
x: 151
y: (screen.is_holiday ? 270 : 250)
- width: 80
height: 20
color: (Script.is_holiday ? theme_manager.theme.markdate.holidays : theme_manager.theme.markdate.not_holidays)
text: Script.__txtInfo_format()
id: txtDAYAmLich
x: 151
y: 330
- width: 80
height: 20
color: "#f0f0f5"
text: Script.__txtDAYAmLich_format()
function menu_item_Clicked(id){
var qmlF = "";
- screen.state="switchX";
+ if (id!=1)
+ screen.state="switchX";
switch(id){
+ case 1: Script.reset_to_default_day(txtTHU, txtInfo, txtDAYAmLich);
+ txtDATEpv.currentIndex = Script.curDay-1;
+ screen.curMonth = Script.curMonth;
+ screen.curYear = Script.curYear;
+ Script.fullmonth.m_day= Script.curDay-1;
+ Script.fullmonth.m_month= Script.curMonth;
+ Script.fullmonth.m_year= Script.curYear;
+ break;
case 2: Script.amdatetimedlg.state="show";break;
case 3: Script.datetimedlg.state="show";break;
case 4: qmlF="XemNgayTotXauHoangDao";break;
Transition { NumberAnimation { properties: "x,y,opacity"; duration: 300; easing.type: Easing.InOutBack } }
]
-
- function reset(){
- /*calculateLunar(initcurDay, initcurMonth, initcurYear)
- LC.reset(initcurDay, initcurMonth, initcurYear)
- screen.state="mainscreen"
- maindatemodel.reset()
- txtDATEpv.currentIndex = initcurDay-1;*/
- }
-
}