summaryrefslogtreecommitdiffabout
path: root/korganizer/calendarview.cpp
authorzautrix <zautrix>2005-07-03 08:42:34 (UTC)
committer zautrix <zautrix>2005-07-03 08:42:34 (UTC)
commit971bfd3cf502fbbafc96bef70e21beb545e450b5 (patch) (side-by-side diff)
tree2d4b2d0d291c5a23bb39e3f448403acbe86cc071 /korganizer/calendarview.cpp
parent914c795a77d8bb28fc8c2155cfc9524f3effdde1 (diff)
downloadkdepimpi-971bfd3cf502fbbafc96bef70e21beb545e450b5.zip
kdepimpi-971bfd3cf502fbbafc96bef70e21beb545e450b5.tar.gz
kdepimpi-971bfd3cf502fbbafc96bef70e21beb545e450b5.tar.bz2
fixes
Diffstat (limited to 'korganizer/calendarview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index a10e93c..72221fd 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -674,17 +674,23 @@ void CalendarView::scrollBarValue(int val )
static bool block = false;
if ( block ) return;
block = true;
- val = val/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep();
- //qDebug("VAL %d ",val );
int count = mNavigator->selectedDates().count();
- int year = mNavigator->selectedDates().first().year();
int day = mNavigator->selectedDates().first().dayOfYear();
- if ( val == day -1 ) {
+ int stepdays = val;
+ if ( mDateScrollBar->lineStep () <= count ) {
+ val = val/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep();
+ //qDebug("VAL %d ",val );
+ stepdays = (val-day)/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep();
+ stepdays = day-1+stepdays;
+ if ( stepdays < 0 ) stepdays = 0;
+ }
+ if ( stepdays == day -1 ) {
block = false;
return;
}
+ int year = mNavigator->selectedDates().first().year();
QDate d ( year,1,1 );
- mNavigator->selectDates( d.addDays( val ), count );
+ mNavigator->selectDates( d.addDays( stepdays) , count );
block = false;
#endif