author | zautrix <zautrix> | 2005-03-16 11:47:11 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-16 11:47:11 (UTC) |
commit | b90787b3fd6cf859c80ddce0f1a2272c7565eec3 (patch) (unidiff) | |
tree | ca87e708078cea9180a8a5123b4d068a2a06a714 | |
parent | 2a92f30dbb2a2bfcee223d949a1672060b76f6ab (diff) | |
download | kdepimpi-b90787b3fd6cf859c80ddce0f1a2272c7565eec3.zip kdepimpi-b90787b3fd6cf859c80ddce0f1a2272c7565eec3.tar.gz kdepimpi-b90787b3fd6cf859c80ddce0f1a2272c7565eec3.tar.bz2 |
drag fix in agenda
-rw-r--r-- | korganizer/koagenda.cpp | 133 | ||||
-rw-r--r-- | korganizer/koagenda.h | 1 |
2 files changed, 63 insertions, 71 deletions
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp index ec81d44..e8b7c94 100644 --- a/korganizer/koagenda.cpp +++ b/korganizer/koagenda.cpp | |||
@@ -374,223 +374,214 @@ bool KOAgenda::eventFilter ( QObject *object, QEvent *event ) | |||
374 | return eventFilter_mouse(object, static_cast<QMouseEvent *>(event)); | 374 | return eventFilter_mouse(object, static_cast<QMouseEvent *>(event)); |
375 | 375 | ||
376 | case (QEvent::Leave): | 376 | case (QEvent::Leave): |
377 | if (!mActionItem) | 377 | if (!mActionItem) |
378 | setCursor(arrowCursor); | 378 | setCursor(arrowCursor); |
379 | return true; | 379 | return true; |
380 | 380 | ||
381 | default: | 381 | default: |
382 | return QScrollView::eventFilter(object,event); | 382 | return QScrollView::eventFilter(object,event); |
383 | } | 383 | } |
384 | } | 384 | } |
385 | 385 | ||
386 | 386 | ||
387 | bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) | 387 | bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) |
388 | { | 388 | { |
389 | //qDebug("KOAgenda::eventFilter_mous "); | 389 | //qDebug("KOAgenda::eventFilter_mous "); |
390 | QPoint viewportPos; | 390 | QPoint viewportPos; |
391 | if (object != viewport()) { | 391 | if (object != viewport()) { |
392 | viewportPos = ((QWidget *)object)->mapToParent(me->pos()); | 392 | viewportPos = ((QWidget *)object)->mapToParent(me->pos()); |
393 | } else { | 393 | } else { |
394 | viewportPos = me->pos(); | 394 | viewportPos = me->pos(); |
395 | } | 395 | } |
396 | static int startX = 0; | 396 | static int startX = 0; |
397 | static int startY = 0; | 397 | static int startY = 0; |
398 | static bool block = true; | 398 | static int blockmoveDist = ( QApplication::desktop()->width() < 480 ? 15 : 20 ); |
399 | static bool blockMoving = true; | ||
400 | static bool leftMouseDown = false; | ||
401 | static bool rightMouseDown = false; | ||
399 | switch (me->type()) { | 402 | switch (me->type()) { |
400 | case QEvent::MouseButtonPress: | 403 | case QEvent::MouseButtonPress: |
401 | //qDebug("QEvent::MouseButtonPress: "); | 404 | if (me->button() == LeftButton) |
402 | // kdDebug() << "koagenda: filtered button press" << endl; | 405 | leftMouseDown = true; |
406 | else if (me->button() == RightButton) | ||
407 | rightMouseDown = true; | ||
408 | blockMoving = true; | ||
409 | startX = viewportPos.x(); | ||
410 | startY = viewportPos.y(); | ||
403 | if (object != viewport()) { | 411 | if (object != viewport()) { |
404 | if (me->button() == RightButton) { | 412 | if (me->button() == RightButton) { |
405 | mClickedItem = (KOAgendaItem *)object; | 413 | mClickedItem = (KOAgendaItem *)object; |
406 | if (mClickedItem) { | 414 | if (mClickedItem) { |
407 | selectItem(mClickedItem); | 415 | selectItem(mClickedItem); |
408 | // emit showIncidencePopupSignal(mClickedItem->incidence()); | ||
409 | } | 416 | } |
410 | //mItemPopup->popup(QCursor::pos()); | 417 | } else if (me->button() == LeftButton) { |
411 | } else { | ||
412 | mActionItem = (KOAgendaItem *)object; | 418 | mActionItem = (KOAgendaItem *)object; |
413 | if (mActionItem) { | 419 | if (mActionItem) { |
414 | if ( mSelectionHeight > 0 ) { | 420 | if ( mSelectionHeight > 0 ) { |
415 | int selectionCellX = mSelectionCellX * mGridSpacingX; | 421 | int selectionCellX = mSelectionCellX * mGridSpacingX; |
416 | int selectionYTop = mSelectionYTop; | 422 | int selectionYTop = mSelectionYTop; |
417 | int gridSpacingX = mGridSpacingX; | 423 | int gridSpacingX = mGridSpacingX; |
418 | int selectionHeight = mSelectionHeight; | 424 | int selectionHeight = mSelectionHeight; |
419 | clearSelection(); | 425 | clearSelection(); |
420 | repaintContents( selectionCellX, selectionYTop, | 426 | repaintContents( selectionCellX, selectionYTop, |
421 | gridSpacingX, selectionHeight,false ); | 427 | gridSpacingX, selectionHeight,false ); |
422 | } | 428 | } |
423 | selectItem(mActionItem); | 429 | selectItem(mActionItem); |
424 | Incidence *incidence = mActionItem->incidence(); | 430 | Incidence *incidence = mActionItem->incidence(); |
425 | if ( incidence->isReadOnly() /*|| incidence->recurrence()->doesRecur() */) { | 431 | if ( incidence->isReadOnly() /*|| incidence->recurrence()->doesRecur() */) { |
426 | mActionItem = 0; | 432 | mActionItem = 0; |
427 | } else { | 433 | } else { |
428 | startItemAction(viewportPos); | 434 | startItemAction(viewportPos); |
429 | startX = viewportPos.x(); | ||
430 | startY = viewportPos.y(); | ||
431 | block = true; | ||
432 | } | 435 | } |
433 | } | 436 | } |
434 | } | 437 | } |
435 | } else { | 438 | } else { // ---------- viewport() |
436 | selectItem(0); | 439 | selectItem(0); |
437 | mActionItem = 0; | 440 | mActionItem = 0; |
438 | if (me->button() == RightButton ) { | 441 | if (me->button() == LeftButton ) { |
439 | blockNewEvent = true; | ||
440 | block = false; | ||
441 | } else { | ||
442 | blockNewEvent = false; | ||
443 | setCursor(arrowCursor); | 442 | setCursor(arrowCursor); |
444 | startSelectAction(viewportPos); | 443 | startSelectAction(viewportPos); |
445 | } | 444 | } |
446 | } | 445 | } |
447 | break; | 446 | break; |
448 | 447 | ||
449 | case QEvent::MouseButtonRelease: | 448 | case QEvent::MouseButtonRelease: |
450 | //qDebug("QEvent::MouseButtonRelease: %d",blockNewEvent ); | ||
451 | if (me->button() == RightButton && blockNewEvent && !block) { | ||
452 | int x,y; | ||
453 | viewportToContents(viewportPos.x(),viewportPos.y(),x,y); | ||
454 | int gx,gy; | ||
455 | contentsToGrid(x,y,gx,gy); | ||
456 | if ( object == viewport() ) { | ||
457 | if ( mCurrentCellY < mStartCellY +1 ) { | ||
458 | //qDebug("mCurrentCellY %d mStartCellY %d ", mCurrentCellY,mStartCellY); | ||
459 | mCurrentCellX = gx; | ||
460 | mCurrentCellY = gy; | ||
461 | mStartCellX = gx; | ||
462 | mStartCellY = gy; | ||
463 | mNewItemPopup->popup( viewport()->mapToGlobal( me->pos() ) ); | ||
464 | break; | ||
465 | } else { | ||
466 | blockNewEvent = false; | ||
467 | } | ||
468 | } else { | ||
469 | mClickedItem = (KOAgendaItem *)object; | ||
470 | if (mActionItem ) { | ||
471 | endItemAction(); | ||
472 | } | ||
473 | if (mClickedItem) { | ||
474 | selectItem(mClickedItem); | ||
475 | emit showIncidencePopupSignal(mClickedItem->incidence()); | ||
476 | } | ||
477 | } | ||
478 | } else if (me->button() == RightButton && block ) { | ||
479 | if (object != viewport()) { | 449 | if (object != viewport()) { |
450 | if (me->button() == RightButton) { | ||
451 | if ( blockMoving ) { | ||
480 | mClickedItem = (KOAgendaItem *)object; | 452 | mClickedItem = (KOAgendaItem *)object; |
481 | if (mActionItem ) { | 453 | if (mActionItem ) { |
482 | endItemAction(); | 454 | endItemAction(); |
483 | } | 455 | } |
456 | leftMouseDown = false; // no more leftMouse computation | ||
484 | if (mClickedItem) { | 457 | if (mClickedItem) { |
485 | selectItem(mClickedItem); | 458 | selectItem(mClickedItem); |
486 | emit showIncidencePopupSignal(mClickedItem->incidence()); | 459 | emit showIncidencePopupSignal(mClickedItem->incidence()); |
487 | } | 460 | } |
488 | } | 461 | } |
489 | break; | 462 | } else if (me->button() == LeftButton && leftMouseDown) { |
490 | } | ||
491 | block = true; | ||
492 | if (mActionItem) { | 463 | if (mActionItem) { |
493 | QPoint clipperPos = clipper()->mapFromGlobal(viewport()->mapToGlobal(viewportPos)); | 464 | QPoint clipperPos = clipper()->mapFromGlobal(viewport()->mapToGlobal(viewportPos)); |
494 | //qDebug(" %d %d %d ",clipperPos.y(),visibleHeight() , 9 ); | 465 | //qDebug(" %d %d %d ",clipperPos.y(),visibleHeight() , 9 ); |
495 | if ( mActionType == MOVE && (clipperPos.y() > visibleHeight()-2 ||clipperPos.y() < 0 ) ) { | 466 | if ( mActionType == MOVE && (clipperPos.y() > visibleHeight()-2 ||clipperPos.y() < 0 ) ) { |
496 | mScrollUpTimer.stop(); | 467 | mScrollUpTimer.stop(); |
497 | mScrollDownTimer.stop(); | 468 | mScrollDownTimer.stop(); |
498 | mActionItem->resetMove(); | 469 | mActionItem->resetMove(); |
499 | placeSubCells( mActionItem ); | 470 | placeSubCells( mActionItem ); |
500 | // emit startDragSignal( mActionItem->incidence() ); | 471 | // emit startDragSignal( mActionItem->incidence() ); |
501 | setCursor( arrowCursor ); | 472 | setCursor( arrowCursor ); |
502 | mActionItem = 0; | 473 | mActionItem = 0; |
503 | mActionType = NOP; | 474 | mActionType = NOP; |
504 | mItemMoved = 0; | 475 | mItemMoved = 0; |
505 | return true; | 476 | return true; |
506 | } | 477 | } |
507 | endItemAction(); | 478 | endItemAction(); |
508 | } else if ( mActionType == SELECT ) { | ||
509 | if (me->button() == RightButton ) { | ||
510 | } else { | ||
511 | endSelectAction( !blockNewEvent ); | ||
512 | } | 479 | } |
513 | } | 480 | } |
481 | |||
482 | } else { // ---------- viewport() | ||
483 | if (me->button() == RightButton) { //right click | ||
484 | if ( blockMoving ) { // we did mot moved the mouse much - popup menu | ||
485 | if ( leftMouseDown ) { // we have a simulated right click - clear left mouse action | ||
486 | endSelectAction( false ); // do not emit new event signal | ||
487 | leftMouseDown = false; // no more leftMouse computation | ||
488 | } | ||
489 | int x,y; | ||
490 | viewportToContents(viewportPos.x(),viewportPos.y(),x,y); | ||
491 | int gx,gy; | ||
492 | contentsToGrid(x,y,gx,gy); | ||
493 | mCurrentCellX = gx; | ||
494 | mCurrentCellY = gy; | ||
495 | mStartCellX = gx; | ||
496 | mStartCellY = gy; | ||
497 | mNewItemPopup->popup( viewport()->mapToGlobal( me->pos() ) ); | ||
498 | } | ||
499 | } | ||
500 | else if (me->button() == LeftButton && leftMouseDown ) { //left click | ||
501 | endSelectAction( true ); // emit new event signal | ||
502 | } | ||
503 | } | ||
504 | if (me->button() == LeftButton) | ||
505 | leftMouseDown = false; | ||
506 | else if (me->button() == RightButton) | ||
507 | rightMouseDown = false; | ||
514 | break; | 508 | break; |
515 | 509 | ||
516 | case QEvent::MouseMove: | 510 | case QEvent::MouseMove: |
517 | if (object != viewport()) { | 511 | if ( !rightMouseDown && !leftMouseDown ) |
518 | KOAgendaItem *moveItem = (KOAgendaItem *)object; | 512 | return true; |
519 | //qDebug("moveItem %d ",moveItem ); | 513 | if ( blockMoving ) { |
520 | if (!moveItem->incidence()->isReadOnly() /*&& | ||
521 | !moveItem->incidence()->recurrence()->doesRecur()*/ ) | ||
522 | if (!mActionItem) | ||
523 | setNoActionCursor(moveItem,viewportPos); | ||
524 | else { | ||
525 | if ( block ) { | ||
526 | int dX, dY; | 514 | int dX, dY; |
527 | dX = startX - viewportPos.x(); | 515 | dX = startX - viewportPos.x(); |
528 | if ( dX < 0 ) | 516 | if ( dX < 0 ) |
529 | dX = -dX; | 517 | dX = -dX; |
530 | dY = viewportPos.y() - startY; | 518 | dY = viewportPos.y() - startY; |
531 | if ( dY < 0 ) | 519 | if ( dY < 0 ) |
532 | dY = -dY; | 520 | dY = -dY; |
533 | int diff = 30; | 521 | //qDebug("%d %d %d ", dX, dY , blockmoveDist ); |
534 | if ( QApplication::desktop()->width() < 480 ) | 522 | if ( dX > blockmoveDist || dY > blockmoveDist ) { |
535 | diff = 15; | 523 | blockMoving = false; |
536 | // qDebug(" %d %d ",dX, dY ); | ||
537 | if ( dX > diff || dY > diff ) { | ||
538 | block = false; | ||
539 | } | 524 | } |
540 | } | 525 | } |
541 | if ( !block ) | 526 | if (object != viewport()) { |
527 | KOAgendaItem *moveItem = (KOAgendaItem *)object; | ||
528 | if (!moveItem->incidence()->isReadOnly() ) { | ||
529 | if (!mActionItem) | ||
530 | setNoActionCursor(moveItem,viewportPos); | ||
531 | else { | ||
532 | if ( !blockMoving ) | ||
542 | performItemAction(viewportPos); | 533 | performItemAction(viewportPos); |
543 | } | 534 | } |
544 | } else { | 535 | } |
536 | } else { // ---------- viewport() | ||
545 | if ( mActionType == SELECT ) { | 537 | if ( mActionType == SELECT ) { |
546 | performSelectAction( viewportPos ); | 538 | performSelectAction( viewportPos ); |
547 | } | 539 | } |
548 | } | 540 | } |
549 | break; | 541 | break; |
550 | 542 | ||
551 | case QEvent::MouseButtonDblClick: | 543 | case QEvent::MouseButtonDblClick: |
552 | if (object == viewport()) { | 544 | if (object == viewport()) { |
553 | selectItem(0); | 545 | selectItem(0); |
554 | int x,y; | 546 | int x,y; |
555 | viewportToContents(viewportPos.x(),viewportPos.y(),x,y); | 547 | viewportToContents(viewportPos.x(),viewportPos.y(),x,y); |
556 | int gx,gy; | 548 | int gx,gy; |
557 | contentsToGrid(x,y,gx,gy); | 549 | contentsToGrid(x,y,gx,gy); |
558 | emit newEventSignal(gx,gy); | 550 | emit newEventSignal(gx,gy); |
559 | } else { | 551 | } else { |
560 | KOAgendaItem *doubleClickedItem = (KOAgendaItem *)object; | 552 | KOAgendaItem *doubleClickedItem = (KOAgendaItem *)object; |
561 | selectItem(doubleClickedItem); | 553 | selectItem(doubleClickedItem); |
562 | if ( KOPrefs::instance()->mEditOnDoubleClick ) | 554 | if ( KOPrefs::instance()->mEditOnDoubleClick ) |
563 | emit editIncidenceSignal(doubleClickedItem->incidence()); | 555 | emit editIncidenceSignal(doubleClickedItem->incidence()); |
564 | else | 556 | else |
565 | emit showIncidenceSignal(doubleClickedItem->incidence()); | 557 | emit showIncidenceSignal(doubleClickedItem->incidence()); |
566 | } | 558 | } |
567 | break; | 559 | break; |
568 | 560 | ||
569 | default: | 561 | default: |
570 | break; | 562 | break; |
571 | } | 563 | } |
572 | |||
573 | return true; | 564 | return true; |
574 | } | 565 | } |
575 | 566 | ||
576 | void KOAgenda::newItem( int item ) | 567 | void KOAgenda::newItem( int item ) |
577 | { | 568 | { |
578 | if ( item == 1 ) { //new event | 569 | if ( item == 1 ) { //new event |
579 | newEventSignal(mStartCellX ,mStartCellY ); | 570 | newEventSignal(mStartCellX ,mStartCellY ); |
580 | } else | 571 | } else |
581 | if ( item == 2 ) { //new event | 572 | if ( item == 2 ) { //new event |
582 | newTodoSignal(mStartCellX ,mStartCellY ); | 573 | newTodoSignal(mStartCellX ,mStartCellY ); |
583 | } else | 574 | } else |
584 | { | 575 | { |
585 | QDate day = mSelectedDates[mStartCellX]; | 576 | QDate day = mSelectedDates[mStartCellX]; |
586 | emit showDateView( item, day ); | 577 | emit showDateView( item, day ); |
587 | // 3Day view | 578 | // 3Day view |
588 | // 4Week view | 579 | // 4Week view |
589 | // 5Month view | 580 | // 5Month view |
590 | // 6Journal view | 581 | // 6Journal view |
591 | } | 582 | } |
592 | } | 583 | } |
593 | void KOAgenda::startSelectAction(QPoint viewportPos) | 584 | void KOAgenda::startSelectAction(QPoint viewportPos) |
594 | { | 585 | { |
595 | //emit newStartSelectSignal(); | 586 | //emit newStartSelectSignal(); |
596 | 587 | ||
@@ -665,51 +656,53 @@ void KOAgenda::performSelectAction(QPoint viewportPos) | |||
665 | mCurrentCellY = gy; | 656 | mCurrentCellY = gy; |
666 | } else if ( gy < mCurrentCellY ) { | 657 | } else if ( gy < mCurrentCellY ) { |
667 | if ( gy >= mStartCellY ) { | 658 | if ( gy >= mStartCellY ) { |
668 | int selectionHeight = mSelectionHeight; | 659 | int selectionHeight = mSelectionHeight; |
669 | mSelectionHeight = ( gy + 1 ) * mGridSpacingY - mSelectionYTop; | 660 | mSelectionHeight = ( gy + 1 ) * mGridSpacingY - mSelectionYTop; |
670 | 661 | ||
671 | repaintContents( (KOGlobals::self()->reverseLayout() ? | 662 | repaintContents( (KOGlobals::self()->reverseLayout() ? |
672 | mColumns - 1 - mSelectionCellX : mSelectionCellX) * | 663 | mColumns - 1 - mSelectionCellX : mSelectionCellX) * |
673 | mGridSpacingX, mSelectionYTop, | 664 | mGridSpacingX, mSelectionYTop, |
674 | mGridSpacingX, selectionHeight,false ); | 665 | mGridSpacingX, selectionHeight,false ); |
675 | 666 | ||
676 | mCurrentCellY = gy; | 667 | mCurrentCellY = gy; |
677 | } else { | 668 | } else { |
678 | } | 669 | } |
679 | } | 670 | } |
680 | } | 671 | } |
681 | 672 | ||
682 | void KOAgenda::endSelectAction( bool emitNewEvent ) | 673 | void KOAgenda::endSelectAction( bool emitNewEvent ) |
683 | { | 674 | { |
684 | mActionType = NOP; | 675 | mActionType = NOP; |
685 | mScrollUpTimer.stop(); | 676 | mScrollUpTimer.stop(); |
686 | mScrollDownTimer.stop(); | 677 | mScrollDownTimer.stop(); |
687 | 678 | ||
688 | emit newTimeSpanSignal(mStartCellX,mStartCellY,mCurrentCellX,mCurrentCellY); | 679 | emit newTimeSpanSignal(mStartCellX,mStartCellY,mCurrentCellX,mCurrentCellY); |
689 | if ( emitNewEvent && mStartCellY < mCurrentCellY ) | 680 | if ( emitNewEvent && mStartCellY < mCurrentCellY ) { |
681 | qDebug("ew event signal "); | ||
690 | emit newEventSignal(mStartCellX,mStartCellY,mCurrentCellX,mCurrentCellY); | 682 | emit newEventSignal(mStartCellX,mStartCellY,mCurrentCellX,mCurrentCellY); |
691 | } | 683 | } |
684 | } | ||
692 | 685 | ||
693 | void KOAgenda::startItemAction(QPoint viewportPos) | 686 | void KOAgenda::startItemAction(QPoint viewportPos) |
694 | { | 687 | { |
695 | int x,y; | 688 | int x,y; |
696 | viewportToContents(viewportPos.x(),viewportPos.y(),x,y); | 689 | viewportToContents(viewportPos.x(),viewportPos.y(),x,y); |
697 | int gx,gy; | 690 | int gx,gy; |
698 | contentsToGrid(x,y,gx,gy); | 691 | contentsToGrid(x,y,gx,gy); |
699 | 692 | ||
700 | mStartCellX = gx; | 693 | mStartCellX = gx; |
701 | mStartCellY = gy; | 694 | mStartCellY = gy; |
702 | mCurrentCellX = gx; | 695 | mCurrentCellX = gx; |
703 | mCurrentCellY = gy; | 696 | mCurrentCellY = gy; |
704 | 697 | ||
705 | if (mAllDayMode) { | 698 | if (mAllDayMode) { |
706 | int gridDistanceX = (x - gx * mGridSpacingX); | 699 | int gridDistanceX = (x - gx * mGridSpacingX); |
707 | if (gridDistanceX < mResizeBorderWidth && | 700 | if (gridDistanceX < mResizeBorderWidth && |
708 | mActionItem->cellX() == mCurrentCellX) { | 701 | mActionItem->cellX() == mCurrentCellX) { |
709 | mActionType = RESIZELEFT; | 702 | mActionType = RESIZELEFT; |
710 | setCursor(sizeHorCursor); | 703 | setCursor(sizeHorCursor); |
711 | } else if ((mGridSpacingX - gridDistanceX) < mResizeBorderWidth && | 704 | } else if ((mGridSpacingX - gridDistanceX) < mResizeBorderWidth && |
712 | mActionItem->cellXWidth() == mCurrentCellX) { | 705 | mActionItem->cellXWidth() == mCurrentCellX) { |
713 | mActionType = RESIZERIGHT; | 706 | mActionType = RESIZERIGHT; |
714 | setCursor(sizeHorCursor); | 707 | setCursor(sizeHorCursor); |
715 | } else { | 708 | } else { |
diff --git a/korganizer/koagenda.h b/korganizer/koagenda.h index 2069b22..f3f1772 100644 --- a/korganizer/koagenda.h +++ b/korganizer/koagenda.h | |||
@@ -189,49 +189,48 @@ class KOAgenda : public QScrollView | |||
189 | void startItemAction(QPoint viewportPos); | 189 | void startItemAction(QPoint viewportPos); |
190 | 190 | ||
191 | /** Move/resize agenda item */ | 191 | /** Move/resize agenda item */ |
192 | void performItemAction(QPoint viewportPos); | 192 | void performItemAction(QPoint viewportPos); |
193 | 193 | ||
194 | /** End moving/resizing agenda item */ | 194 | /** End moving/resizing agenda item */ |
195 | void endItemAction(); | 195 | void endItemAction(); |
196 | 196 | ||
197 | /** Set cursor, when no item action is in progress */ | 197 | /** Set cursor, when no item action is in progress */ |
198 | void setNoActionCursor(KOAgendaItem *moveItem,QPoint viewportPos); | 198 | void setNoActionCursor(KOAgendaItem *moveItem,QPoint viewportPos); |
199 | 199 | ||
200 | /** Place agenda item in agenda and adjust other cells if necessary */ | 200 | /** Place agenda item in agenda and adjust other cells if necessary */ |
201 | void placeSubCells(KOAgendaItem *placeItem); | 201 | void placeSubCells(KOAgendaItem *placeItem); |
202 | 202 | ||
203 | /** Process the keyevent, including the ignored keyevents of eventwidgets. | 203 | /** Process the keyevent, including the ignored keyevents of eventwidgets. |
204 | * Implements pgup/pgdn and cursor key navigation in the view. | 204 | * Implements pgup/pgdn and cursor key navigation in the view. |
205 | */ | 205 | */ |
206 | void keyPressEvent( QKeyEvent * ); | 206 | void keyPressEvent( QKeyEvent * ); |
207 | 207 | ||
208 | void calculateWorkingHours(); | 208 | void calculateWorkingHours(); |
209 | 209 | ||
210 | virtual void contentsMousePressEvent ( QMouseEvent * ); | 210 | virtual void contentsMousePressEvent ( QMouseEvent * ); |
211 | 211 | ||
212 | private: | 212 | private: |
213 | bool blockNewEvent; | ||
214 | void init(); | 213 | void init(); |
215 | void marcus_bains(); | 214 | void marcus_bains(); |
216 | bool mAllDayMode; | 215 | bool mAllDayMode; |
217 | bool blockResize; | 216 | bool blockResize; |
218 | QTimer mResizeTimer; | 217 | QTimer mResizeTimer; |
219 | double mContentPosition; | 218 | double mContentPosition; |
220 | 219 | ||
221 | // Width and height of agenda cells | 220 | // Width and height of agenda cells |
222 | int mGridSpacingX; | 221 | int mGridSpacingX; |
223 | int mGridSpacingY; | 222 | int mGridSpacingY; |
224 | 223 | ||
225 | // size of border, where mouse action will resize the KOAgendaItem | 224 | // size of border, where mouse action will resize the KOAgendaItem |
226 | int mResizeBorderWidth; | 225 | int mResizeBorderWidth; |
227 | 226 | ||
228 | // size of border, where mouse mve will cause a scroll of the agenda | 227 | // size of border, where mouse mve will cause a scroll of the agenda |
229 | int mScrollBorderWidth; | 228 | int mScrollBorderWidth; |
230 | int mScrollDelay; | 229 | int mScrollDelay; |
231 | int mScrollOffset; | 230 | int mScrollOffset; |
232 | 231 | ||
233 | QTimer mScrollUpTimer; | 232 | QTimer mScrollUpTimer; |
234 | QTimer mScrollDownTimer; | 233 | QTimer mScrollDownTimer; |
235 | 234 | ||
236 | // Number of Columns/Rows of agenda grid | 235 | // Number of Columns/Rows of agenda grid |
237 | int mColumns; | 236 | int mColumns; |