X-Git-Url: http://git.maemo.org/git/?p=lichviet;a=blobdiff_plain;f=qml%2FLichViet%2Fmain.qml;fp=qml%2FLichViet%2Fmain.qml;h=ae8e241bb203369961fdb7dc6310d03f78bbde8b;hp=d9f2d59eeac9722d961d4469f6748501e4495b08;hb=31922fa7094d9554f2d6cef18a4f796ba22993ae;hpb=274c1daf9c51c4127195b5e8370722887dace99e diff --git a/qml/LichViet/main.qml b/qml/LichViet/main.qml index d9f2d59..ae8e241 100644 --- a/qml/LichViet/main.qml +++ b/qml/LichViet/main.qml @@ -23,8 +23,8 @@ import "main.js" as Script Item { id: screen - width: 800 - height: 480 + width: 480 + height: 800 state:"mainscreen" @@ -43,7 +43,9 @@ Item { 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(); @@ -61,6 +63,10 @@ Item { 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 { @@ -70,10 +76,10 @@ Item { state:"jumptodate" - /*Image { + Image { source: theme_manager.theme.background_image; fillMode: Image.Stretch; anchors.fill: parent opacity: theme_manager.theme.background_opacity - }*/ + } MouseArea { @@ -95,8 +101,8 @@ Item { onDoubleClicked:{ if (Settings.doubleclicked()==1){ - screen.state="datetimedialog"; - + screen.state="switchX"; + Script.datetimedlg.state="show"; } } } @@ -122,7 +128,24 @@ Item { 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; + } } } } @@ -162,6 +185,10 @@ Item { 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(); } } } @@ -297,8 +324,17 @@ Item { 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; @@ -333,13 +369,4 @@ Item { 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;*/ - } - }