summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-03-21 09:12:37 (UTC)
committer zautrix <zautrix>2005-03-21 09:12:37 (UTC)
commit9707cf053ab0e64949518ebd2729d432435f583c (patch) (side-by-side diff)
treedad8fca3e1eafc17062f1f183f50bfdb3fac5b8b
parente0351d382e7344191c3a7963eefe3396f816f7a0 (diff)
downloadkdepimpi-9707cf053ab0e64949518ebd2729d432435f583c.zip
kdepimpi-9707cf053ab0e64949518ebd2729d432435f583c.tar.gz
kdepimpi-9707cf053ab0e64949518ebd2729d432435f583c.tar.bz2
agenda mouse fix
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--korganizer/koagenda.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp
index 8c2996b..dcb46a8 100644
--- a/korganizer/koagenda.cpp
+++ b/korganizer/koagenda.cpp
@@ -174,9 +174,9 @@ KOAgenda::KOAgenda(int columns,int rows,int rowSize,QWidget *parent,
mRows = rows;
mGridSpacingY = rowSize;
mAllDayMode = false;
#ifndef DESKTOP_VERSION
- QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold );
+ //QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold );
#endif
mHolidayMask = 0;
init();
}
@@ -398,12 +398,16 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me)
static int blockmoveDist = ( QApplication::desktop()->width() < 480 ? 15 : 20 );
static bool blockMoving = true;
static bool leftMouseDown = false;
static bool rightMouseDown = false;
+ static QTime rightClickTime;
+ bool rightButtonPressed = false;
switch (me->type()) {
case QEvent::MouseButtonPress:
- if (me->button() == LeftButton)
+ rightClickTime.restart();
+ if (me->button() == LeftButton) {
leftMouseDown = true;
+ }
else if (me->button() == RightButton)
rightMouseDown = true;
blockMoving = true;
startX = viewportPos.x();
@@ -445,10 +449,12 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me)
}
break;
case QEvent::MouseButtonRelease:
+ if ( rightClickTime.elapsed() > 700 && blockMoving )
+ rightButtonPressed = true;
if (object != viewport()) {
- if (me->button() == RightButton) {
+ if (me->button() == RightButton || rightButtonPressed ) {
if ( blockMoving ) {
mClickedItem = (KOAgendaItem *)object;
if (mActionItem ) {
endItemAction();
@@ -472,16 +478,17 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me)
setCursor( arrowCursor );
mActionItem = 0;
mActionType = NOP;
mItemMoved = 0;
+ leftMouseDown = false;
return true;
}
endItemAction();
}
}
} else { // ---------- viewport()
- if (me->button() == RightButton) { //right click
+ if (me->button() == RightButton || rightButtonPressed ) { //right click
if ( blockMoving ) { // we did mot moved the mouse much - popup menu
if ( leftMouseDown ) { // we have a simulated right click - clear left mouse action
endSelectAction( false ); // do not emit new event signal
leftMouseDown = false; // no more leftMouse computation