summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-06-25 10:59:43 (UTC)
committer zautrix <zautrix>2005-06-25 10:59:43 (UTC)
commit70e025b560e0060804610c182d3b04a6e6a63b70 (patch) (side-by-side diff)
treea9847909ef7878ccb39c69cfec16568bc3632ea6
parentb81bdd12cadbae5a3ab5a7f1f689bb4ae45cf315 (diff)
downloadkdepimpi-70e025b560e0060804610c182d3b04a6e6a63b70.zip
kdepimpi-70e025b560e0060804610c182d3b04a6e6a63b70.tar.gz
kdepimpi-70e025b560e0060804610c182d3b04a6e6a63b70.tar.bz2
fixxxx
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--korganizer/koagenda.cpp54
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
@@ -451,28 +451,78 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me)
}
QPoint viewportPos;
if (object != viewport()) {
blockmoveDist = blockmoveDist*2;
viewportPos = ((QWidget *)object)->mapToParent(me->pos());
} else {
viewportPos = me->pos();
}
-
+ bool objIsNotViewport = (object != viewport());
switch (me->type()) {
case QEvent::MouseButtonPress:
if (me->button() == LeftButton) {
mPopupTimer->start( 600 );
mLeftMouseDown = true;
}
blockMoving = true;
startX = viewportPos.x();
startY = viewportPos.y();
mPopupPos = me->globalPos();
- if (object != viewport()) {
+ if ( objIsNotViewport ) {
+ KOAgendaItem * tempItem = (KOAgendaItem *)object;
+ if (mAllDayMode) {
+ if ( tempItem->height() > 10 ) {
+ int minV = tempItem->height()/4;
+ if ( minV > (blockmoveDist/2)-2 )
+ minV = (blockmoveDist/2)-2;
+ bool border = false;
+ int diff = tempItem->y() - viewportPos.y();
+ if ( diff < 0 )
+ diff *= -1;
+ if ( diff < minV ) {
+ border = true;
+ objIsNotViewport = false;
+ }
+ if ( ! border ) {
+ diff = tempItem->y() + tempItem->height()- viewportPos.y();
+ if ( diff < 0 )
+ diff *= -1;
+ if ( diff < minV ) {
+ border = true;
+ objIsNotViewport = false;
+ }
+ }
+ }
+ } else { // not allday
+ if ( tempItem->width() > 10 ) {
+ int minH = tempItem->width()/4;
+ if ( minH > (blockmoveDist/2)-2 )
+ minH = (blockmoveDist/2)-2;
+ bool border = false;
+ int diff = tempItem->x() - viewportPos.x();
+ if ( diff < 0 )
+ diff *= -1;
+ if ( diff < minH ) {
+ border = true;
+ objIsNotViewport = false;
+ }
+ if ( ! border ) {
+ diff = tempItem->x() + tempItem->width() - viewportPos.x();
+ if ( diff < 0 )
+ diff *= -1;
+ if ( diff < minH ) {
+ border = true;
+ objIsNotViewport = false;
+ }
+ }
+ }
+ }
+ }
+ if ( objIsNotViewport ) {
mPopupItem = (KOAgendaItem *)object;
mPopupKind = 1;
if (me->button() == RightButton) {
mPopupKind = 3;
popupMenu();
} else if (me->button() == LeftButton) {
mActionItem = (KOAgendaItem *)object;
if (mActionItem) {