From 70e025b560e0060804610c182d3b04a6e6a63b70 Mon Sep 17 00:00:00 2001 From: zautrix Date: Sat, 25 Jun 2005 10:59:43 +0000 Subject: fixxxx --- (limited to 'korganizer/koagenda.cpp') diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp index fc213d8..b99625c 100644 --- a/korganizer/koagenda.cpp +++ b/korganizer/koagenda.cpp @@ -456,7 +456,7 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) } else { viewportPos = me->pos(); } - + bool objIsNotViewport = (object != viewport()); switch (me->type()) { case QEvent::MouseButtonPress: if (me->button() == LeftButton) { @@ -467,7 +467,57 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) 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) { -- cgit v0.9.0.2