summaryrefslogtreecommitdiffabout
path: root/korganizer/kodaymatrix.cpp
authorzautrix <zautrix>2005-04-01 18:10:09 (UTC)
committer zautrix <zautrix>2005-04-01 18:10:09 (UTC)
commitedc032c21ae3788d02a632ea8066e4ac5a4feedb (patch) (unidiff)
tree8e59c8dcf1cc3021694025627d36e152f7adc389 /korganizer/kodaymatrix.cpp
parent5d88f92b76a760f100384ea5fa6ed143088d19bb (diff)
downloadkdepimpi-edc032c21ae3788d02a632ea8066e4ac5a4feedb.zip
kdepimpi-edc032c21ae3788d02a632ea8066e4ac5a4feedb.tar.gz
kdepimpi-edc032c21ae3788d02a632ea8066e4ac5a4feedb.tar.bz2
fixes
Diffstat (limited to 'korganizer/kodaymatrix.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kodaymatrix.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp
index dfc6af7..c55f7d7 100644
--- a/korganizer/kodaymatrix.cpp
+++ b/korganizer/kodaymatrix.cpp
@@ -285,13 +285,14 @@ void KODayMatrix::addSelectedDaysTo(DateList& selDays)
285 selDays.append(days[i]); 285 selDays.append(days[i]);
286 } 286 }
287 } 287 }
288} 288}
289 289
290bool KODayMatrix::setSelectedDaysFrom(const QDate& start, const QDate& end) 290bool KODayMatrix::setSelectedDaysFrom(const QDate& start, const QDate& end)
291{ 291{
292 mRedrawNeeded = true;
292 bool noSel = (mSelEnd == NOSELECTION && mSelStart == NOSELECTION ); 293 bool noSel = (mSelEnd == NOSELECTION && mSelStart == NOSELECTION );
293 mSelStart = startdate.daysTo(start); 294 mSelStart = startdate.daysTo(start);
294 if ( mSelStart < 0 ) 295 if ( mSelStart < 0 )
295 mSelStart = 0; 296 mSelStart = 0;
296 mSelEnd = startdate.daysTo(end); 297 mSelEnd = startdate.daysTo(end);
297 if ( mSelEnd > NUMDAYS-1 ) 298 if ( mSelEnd > NUMDAYS-1 )
@@ -507,18 +508,20 @@ void KODayMatrix::mousePressEvent (QMouseEvent* e)
507 508
508 if ( e->button() == LeftButton ) 509 if ( e->button() == LeftButton )
509 mouseDown = true; 510 mouseDown = true;
510 mSelStart = getDayIndexFrom(e->x(), e->y()); 511 mSelStart = getDayIndexFrom(e->x(), e->y());
511 if (mSelStart > NUMDAYS-1) mSelStart=NUMDAYS-1; 512 if (mSelStart > NUMDAYS-1) mSelStart=NUMDAYS-1;
512 mSelInit = mSelStart; 513 mSelInit = mSelStart;
513 mSelEnd = mSelStart; 514 mSelEnd = mSelStart;
515 mRedrawNeeded = true;
514 repaint(false); 516 repaint(false);
515} 517}
516 518
517void KODayMatrix::mouseReleaseEvent (QMouseEvent* e) 519void KODayMatrix::mouseReleaseEvent (QMouseEvent* e)
518{ 520{
521 mRedrawNeeded = true;
519 if ( e->button() == LeftButton ) 522 if ( e->button() == LeftButton )
520 if ( ! mouseDown ) { 523 if ( ! mouseDown ) {
521 return; 524 return;
522 } 525 }
523 else 526 else
524 mouseDown = false; 527 mouseDown = false;
@@ -553,12 +556,13 @@ void KODayMatrix::mouseReleaseEvent (QMouseEvent* e)
553 556
554void KODayMatrix::mouseMoveEvent (QMouseEvent* e) 557void KODayMatrix::mouseMoveEvent (QMouseEvent* e)
555{ 558{
556 if ( ! mouseDown ) { 559 if ( ! mouseDown ) {
557 return; 560 return;
558 } 561 }
562 mRedrawNeeded = true;
559 int tmp = getDayIndexFrom(e->x(), e->y()); 563 int tmp = getDayIndexFrom(e->x(), e->y());
560 if (tmp > NUMDAYS-1) tmp=NUMDAYS-1; 564 if (tmp > NUMDAYS-1) tmp=NUMDAYS-1;
561 565
562 if (mSelInit > tmp) { 566 if (mSelInit > tmp) {
563 mSelEnd = mSelInit; 567 mSelEnd = mSelInit;
564 if (tmp != mSelStart) { 568 if (tmp != mSelStart) {