author | zautrix <zautrix> | 2005-01-30 20:31:35 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-01-30 20:31:35 (UTC) |
commit | 15c5772f8a54750115f82aea34fea47e5842ff4f (patch) (side-by-side diff) | |
tree | 13c31b5fd3d41058b65a392acf17ee3efd230f33 /korganizer/koagenda.cpp | |
parent | 23d345c877ae9de6a077af3705026d15bb04d1e3 (diff) | |
download | kdepimpi-15c5772f8a54750115f82aea34fea47e5842ff4f.zip kdepimpi-15c5772f8a54750115f82aea34fea47e5842ff4f.tar.gz kdepimpi-15c5772f8a54750115f82aea34fea47e5842ff4f.tar.bz2 |
fix
-rw-r--r-- | korganizer/koagenda.cpp | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp index 0aef929..ffa2678 100644 --- a/korganizer/koagenda.cpp +++ b/korganizer/koagenda.cpp @@ -438,17 +438,7 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) mActionItem = 0; if (me->button() == RightButton ) { blockNewEvent = true; - //qDebug("right "); - int x,y; - viewportToContents(viewportPos.x(),viewportPos.y(),x,y); - int gx,gy; - contentsToGrid(x,y,gx,gy); - mStartCellX = gx; - mStartCellY = gy; - mCurrentCellX = gx; - mCurrentCellY = gy; - mNewItemPopup->popup( viewport()->mapToGlobal( me->pos() ) ); - + block = false; } else { blockNewEvent = false; setCursor(arrowCursor); @@ -458,8 +448,24 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) break; case QEvent::MouseButtonRelease: - //qDebug("QEvent::MouseButtonRelease: "); - if (me->button() == RightButton && block ) { + //qDebug("QEvent::MouseButtonRelease: %d",blockNewEvent ); + if (me->button() == RightButton && blockNewEvent && !block) { + int x,y; + viewportToContents(viewportPos.x(),viewportPos.y(),x,y); + int gx,gy; + 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; + } else { + blockNewEvent = false; + } + } else if (me->button() == RightButton && block ) { if (object != viewport()) { mClickedItem = (KOAgendaItem *)object; if (mActionItem ) { @@ -489,9 +495,8 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) return true; } endItemAction(); - } else if ( mActionType == SELECT ) { + } else if ( mActionType == SELECT ) { if (me->button() == RightButton ) { - } else { endSelectAction( !blockNewEvent ); } |