-rw-r--r-- | korganizer/koagenda.cpp | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp index ffa2678..a72e470 100644 --- a/korganizer/koagenda.cpp +++ b/korganizer/koagenda.cpp @@ -404,3 +404,2 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) if (me->button() == RightButton) { - mClickedItem = (KOAgendaItem *)object; @@ -456,12 +455,23 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) contentsToGrid(x,y,gx,gy); - if ( mCurrentCellY < mStartCellY +1 ) { - //qDebug("mCurrentCellY %d mStartCellY %d ", mCurrentCellY,mStartCellY); - mCurrentCellX = gx; - mCurrentCellY = gy; - mStartCellX = gx; - mStartCellY = gy; - mNewItemPopup->popup( viewport()->mapToGlobal( me->pos() ) ); - break; + if ( object == viewport() ) { + if ( mCurrentCellY < mStartCellY +1 ) { + //qDebug("mCurrentCellY %d mStartCellY %d ", mCurrentCellY,mStartCellY); + mCurrentCellX = gx; + mCurrentCellY = gy; + mStartCellX = gx; + mStartCellY = gy; + mNewItemPopup->popup( viewport()->mapToGlobal( me->pos() ) ); + break; + } else { + blockNewEvent = false; + } } else { - blockNewEvent = false; + mClickedItem = (KOAgendaItem *)object; + if (mActionItem ) { + endItemAction(); + } + if (mClickedItem) { + selectItem(mClickedItem); + emit showIncidencePopupSignal(mClickedItem->incidence()); + } } |