author | zautrix <zautrix> | 2005-06-25 10:59:43 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-06-25 10:59:43 (UTC) |
commit | 70e025b560e0060804610c182d3b04a6e6a63b70 (patch) (unidiff) | |
tree | a9847909ef7878ccb39c69cfec16568bc3632ea6 | |
parent | b81bdd12cadbae5a3ab5a7f1f689bb4ae45cf315 (diff) | |
download | kdepimpi-70e025b560e0060804610c182d3b04a6e6a63b70.zip kdepimpi-70e025b560e0060804610c182d3b04a6e6a63b70.tar.gz kdepimpi-70e025b560e0060804610c182d3b04a6e6a63b70.tar.bz2 |
fixxxx
-rw-r--r-- | korganizer/koagenda.cpp | 54 |
1 files changed, 52 insertions, 2 deletions
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp index fc213d8..b99625c 100644 --- a/korganizer/koagenda.cpp +++ b/korganizer/koagenda.cpp | |||
@@ -453,24 +453,74 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) | |||
453 | if (object != viewport()) { | 453 | if (object != viewport()) { |
454 | blockmoveDist = blockmoveDist*2; | 454 | blockmoveDist = blockmoveDist*2; |
455 | viewportPos = ((QWidget *)object)->mapToParent(me->pos()); | 455 | viewportPos = ((QWidget *)object)->mapToParent(me->pos()); |
456 | } else { | 456 | } else { |
457 | viewportPos = me->pos(); | 457 | viewportPos = me->pos(); |
458 | } | 458 | } |
459 | 459 | bool objIsNotViewport = (object != viewport()); | |
460 | switch (me->type()) { | 460 | switch (me->type()) { |
461 | case QEvent::MouseButtonPress: | 461 | case QEvent::MouseButtonPress: |
462 | if (me->button() == LeftButton) { | 462 | if (me->button() == LeftButton) { |
463 | mPopupTimer->start( 600 ); | 463 | mPopupTimer->start( 600 ); |
464 | mLeftMouseDown = true; | 464 | mLeftMouseDown = true; |
465 | } | 465 | } |
466 | blockMoving = true; | 466 | blockMoving = true; |
467 | startX = viewportPos.x(); | 467 | startX = viewportPos.x(); |
468 | startY = viewportPos.y(); | 468 | startY = viewportPos.y(); |
469 | mPopupPos = me->globalPos(); | 469 | mPopupPos = me->globalPos(); |
470 | if (object != viewport()) { | 470 | if ( objIsNotViewport ) { |
471 | KOAgendaItem * tempItem = (KOAgendaItem *)object; | ||
472 | if (mAllDayMode) { | ||
473 | if ( tempItem->height() > 10 ) { | ||
474 | int minV = tempItem->height()/4; | ||
475 | if ( minV > (blockmoveDist/2)-2 ) | ||
476 | minV = (blockmoveDist/2)-2; | ||
477 | bool border = false; | ||
478 | int diff = tempItem->y() - viewportPos.y(); | ||
479 | if ( diff < 0 ) | ||
480 | diff *= -1; | ||
481 | if ( diff < minV ) { | ||
482 | border = true; | ||
483 | objIsNotViewport = false; | ||
484 | } | ||
485 | if ( ! border ) { | ||
486 | diff = tempItem->y() + tempItem->height()- viewportPos.y(); | ||
487 | if ( diff < 0 ) | ||
488 | diff *= -1; | ||
489 | if ( diff < minV ) { | ||
490 | border = true; | ||
491 | objIsNotViewport = false; | ||
492 | } | ||
493 | } | ||
494 | } | ||
495 | } else { // not allday | ||
496 | if ( tempItem->width() > 10 ) { | ||
497 | int minH = tempItem->width()/4; | ||
498 | if ( minH > (blockmoveDist/2)-2 ) | ||
499 | minH = (blockmoveDist/2)-2; | ||
500 | bool border = false; | ||
501 | int diff = tempItem->x() - viewportPos.x(); | ||
502 | if ( diff < 0 ) | ||
503 | diff *= -1; | ||
504 | if ( diff < minH ) { | ||
505 | border = true; | ||
506 | objIsNotViewport = false; | ||
507 | } | ||
508 | if ( ! border ) { | ||
509 | diff = tempItem->x() + tempItem->width() - viewportPos.x(); | ||
510 | if ( diff < 0 ) | ||
511 | diff *= -1; | ||
512 | if ( diff < minH ) { | ||
513 | border = true; | ||
514 | objIsNotViewport = false; | ||
515 | } | ||
516 | } | ||
517 | } | ||
518 | } | ||
519 | } | ||
520 | if ( objIsNotViewport ) { | ||
471 | mPopupItem = (KOAgendaItem *)object; | 521 | mPopupItem = (KOAgendaItem *)object; |
472 | mPopupKind = 1; | 522 | mPopupKind = 1; |
473 | if (me->button() == RightButton) { | 523 | if (me->button() == RightButton) { |
474 | mPopupKind = 3; | 524 | mPopupKind = 3; |
475 | popupMenu(); | 525 | popupMenu(); |
476 | } else if (me->button() == LeftButton) { | 526 | } else if (me->button() == LeftButton) { |