-rw-r--r-- | korganizer/koagenda.cpp | 15 |
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 | |||
@@ -177,3 +177,3 @@ KOAgenda::KOAgenda(int columns,int rows,int rowSize,QWidget *parent, | |||
177 | #ifndef DESKTOP_VERSION | 177 | #ifndef DESKTOP_VERSION |
178 | QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold ); | 178 | //QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold ); |
179 | #endif | 179 | #endif |
@@ -401,6 +401,10 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) | |||
401 | static bool rightMouseDown = false; | 401 | static bool rightMouseDown = false; |
402 | static QTime rightClickTime; | ||
403 | bool rightButtonPressed = false; | ||
402 | switch (me->type()) { | 404 | switch (me->type()) { |
403 | case QEvent::MouseButtonPress: | 405 | case QEvent::MouseButtonPress: |
404 | if (me->button() == LeftButton) | 406 | rightClickTime.restart(); |
407 | if (me->button() == LeftButton) { | ||
405 | leftMouseDown = true; | 408 | leftMouseDown = true; |
409 | } | ||
406 | else if (me->button() == RightButton) | 410 | else if (me->button() == RightButton) |
@@ -448,4 +452,6 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) | |||
448 | case QEvent::MouseButtonRelease: | 452 | case QEvent::MouseButtonRelease: |
453 | if ( rightClickTime.elapsed() > 700 && blockMoving ) | ||
454 | rightButtonPressed = true; | ||
449 | if (object != viewport()) { | 455 | if (object != viewport()) { |
450 | if (me->button() == RightButton) { | 456 | if (me->button() == RightButton || rightButtonPressed ) { |
451 | if ( blockMoving ) { | 457 | if ( blockMoving ) { |
@@ -475,2 +481,3 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) | |||
475 | mItemMoved = 0; | 481 | mItemMoved = 0; |
482 | leftMouseDown = false; | ||
476 | return true; | 483 | return true; |
@@ -482,3 +489,3 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) | |||
482 | } else { // ---------- viewport() | 489 | } else { // ---------- viewport() |
483 | if (me->button() == RightButton) { //right click | 490 | if (me->button() == RightButton || rightButtonPressed ) { //right click |
484 | if ( blockMoving ) { // we did mot moved the mouse much - popup menu | 491 | if ( blockMoving ) { // we did mot moved the mouse much - popup menu |