From: Cuong Le Date: Sat, 27 Aug 2011 07:56:49 +0000 (+0700) Subject: * Fixes for pathview date component (slowly in date switching) X-Git-Tag: v1.0.2-4~2^2~1 X-Git-Url: http://git.maemo.org/git/?p=lichviet;a=commitdiff_plain;h=83b565e45f3070ce045beddba13d505b6850a614 * Fixes for pathview date component (slowly in date switching) * Changed debian/changelog to version 1.0.2-3 --- diff --git a/qml/LichViet/About.qml b/qml/LichViet/About.qml index adb96ee..4d4751a 100644 --- a/qml/LichViet/About.qml +++ b/qml/LichViet/About.qml @@ -71,7 +71,7 @@ Item{ y: 234 width: 80 height: 20 - text: "Phiên bản : 1.0.2-1-beta (25/08/2011)
\ + text: "Phiên bản : 1.0.2-3 (25/08/2011)
\ Phát triển bởi : metacuong@gmail.com" anchors.horizontalCenterOffset: 0 wrapMode: Text.NoWrap diff --git a/qml/LichViet/DateTimeDialog.qml b/qml/LichViet/DateTimeDialog.qml index e6eb564..2095953 100644 --- a/qml/LichViet/DateTimeDialog.qml +++ b/qml/LichViet/DateTimeDialog.qml @@ -57,13 +57,11 @@ Item{ text: "OK" visible: true onClicked: { - LC.reset(datePicker.mDay,datePicker.mMonth,datePicker.mYear) screen.calculateLunar(datePicker.mDay,datePicker.mMonth,datePicker.mYear) screen.state="mainscreen" screen.refresh() maindatemodel.reset() - txtDATEpv.currentIndex = datePicker.mDay-1; } } diff --git a/qml/LichViet/main.qml b/qml/LichViet/main.qml index 565b3ad..1c7eb47 100644 --- a/qml/LichViet/main.qml +++ b/qml/LichViet/main.qml @@ -113,8 +113,8 @@ Item { Rectangle { id:reelx - width: 300 - height: 100 + width: 260 + height: 90 y: 116 anchors.horizontalCenter: parent.horizontalCenter property int index: 0 @@ -158,15 +158,30 @@ Item { delegate: delegate pathItemCount: 3 clip: true + highlightMoveDuration:500 + Keys.onDownPressed: if (!moving && interactive) incrementCurrentIndex() + Keys.onUpPressed: if (!moving && interactive) decrementCurrentIndex() preferredHighlightBegin: 0.5 preferredHighlightEnd: 0.5 highlightRangeMode: PathView.StrictlyEnforceRange focus: true + interactive: true + highlight: Rectangle{ + anchors.topMargin: 10; + width:110; + height:80; + radius: 8; + color:"#000000" + opacity: 0.3 + } path: Path { startX: 0 startY: 50 PathLine {x: reelx.width; y: 50} } + onFlickEnded : { + } + onMovementEnded: { calculateLunar(txtDATEpv.currentIndex+1, LC.curMonth(), LC.curYear()) } @@ -176,19 +191,43 @@ Item { id:maindatemodel function reset(){ + var days_of_this_month = LC.calDays(screen.curMonth,screen.curYear); + var days_of_changes = days_of_this_month - maindatemodel.count; + + var ifs; + + if (days_of_changes<0){ + ifs=Math.abs(days_of_changes); + while(ifs>0){ + maindatemodel.remove(maindatemodel.count-1); + ifs-=1; + } + }else if(days_of_changes>0){ + ifs=maindatemodel.count; + for (var i=1;i<=days_of_changes;i++) + append({name:i+ifs}) + } + + reelx.index = -1; // I dont now why must be added -1 before screen.curDay-1 + reelx.index = screen.curDay-1; + + } + + function init(){ while(maindatemodel.count>0){ try{maindatemodel.remove(maindatemodel.count-1)}catch(e){} } for(var i=1;i<=LC.calDays(screen.curMonth,screen.curYear);i++) append({name:i}) + reelx.index = screen.curDay -1 } } //------------------------------------------------- Component.onCompleted: { - maindatemodel.reset() + maindatemodel.init() } Text { @@ -330,6 +369,13 @@ Item { states: [ State { + name:"mainscreen" + StateChangeScript { + script:{ + } + } + }, + State { name: "menuscreen"; PropertyChanges { target: menuScreen; x: 0; focus:true} PropertyChanges { target: toolBar; y: screen.height } @@ -457,6 +503,7 @@ Item { } function refresh(){ + } Component.onCompleted: { diff --git a/qtc_packaging/debian_fremantle/changelog b/qtc_packaging/debian_fremantle/changelog index 45e9f84..9ccfe2a 100644 --- a/qtc_packaging/debian_fremantle/changelog +++ b/qtc_packaging/debian_fremantle/changelog @@ -1,5 +1,5 @@ -lichviet (1.0.2-1) unstable-develop; urgency=low +lichviet (1.0.2-3) unstable-develop; urgency=low - * Release 1.0.2-1-beta + * Fixes for pathview date component (slowly in date switching) - -- Cuong Le Thu, 25 Aug 2011 13:30:37 +0700 + -- Cuong Le Thu, 27 Aug 2011 14:40:37 +0700