summaryrefslogtreecommitdiffabout
path: root/korganizer/koagenda.cpp
Unidiff
Diffstat (limited to 'korganizer/koagenda.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagenda.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp
index ce73168..f860f7d 100644
--- a/korganizer/koagenda.cpp
+++ b/korganizer/koagenda.cpp
@@ -387,49 +387,58 @@ void KOAgenda::popupMenu()
387 } 387 }
388 mLeftMouseDown = false; // no more leftMouse computation 388 mLeftMouseDown = false; // no more leftMouse computation
389 if (mPopupItem) { 389 if (mPopupItem) {
390 //mClickedItem = mPopupItem; 390 //mClickedItem = mPopupItem;
391 selectItem(mPopupItem); 391 selectItem(mPopupItem);
392 if ( mAllAgendaPopup && KOPrefs::instance()->mBlockPopupMenu && mPopupKind == 1 ) 392 if ( mAllAgendaPopup && KOPrefs::instance()->mBlockPopupMenu && mPopupKind == 1 )
393 mAllAgendaPopup->installEventFilter( this ); 393 mAllAgendaPopup->installEventFilter( this );
394 emit showIncidencePopupSignal(mPopupItem->incidence()); 394 emit showIncidencePopupSignal(mPopupItem->incidence());
395 395
396 } 396 }
397 } else if ( mPopupKind == 2 || mPopupKind == 4 ) { 397 } else if ( mPopupKind == 2 || mPopupKind == 4 ) {
398 if ( mLeftMouseDown ) { // we have a simulated right click - clear left mouse action 398 if ( mLeftMouseDown ) { // we have a simulated right click - clear left mouse action
399 endSelectAction( false ); // do not emit new event signal 399 endSelectAction( false ); // do not emit new event signal
400 mLeftMouseDown = false; // no more leftMouse computation 400 mLeftMouseDown = false; // no more leftMouse computation
401 } 401 }
402 if ( KOPrefs::instance()->mBlockPopupMenu && mPopupKind == 2 ) 402 if ( KOPrefs::instance()->mBlockPopupMenu && mPopupKind == 2 )
403 mNewItemPopup->installEventFilter( this ); 403 mNewItemPopup->installEventFilter( this );
404 mNewItemPopup->popup( mPopupPos); 404 mNewItemPopup->popup( mPopupPos);
405 405
406 } 406 }
407 mLeftMouseDown = false; 407 mLeftMouseDown = false;
408 mPopupItem = 0; 408 mPopupItem = 0;
409 mPopupKind = 0; 409 mPopupKind = 0;
410} 410}
411 411void KOAgenda::categoryChanged(Incidence * inc)
412{
413 KOAgendaItem *item;
414 for ( item=mItems.first(); item != 0; item=mItems.next() ) {
415 if ( item->incidence() == inc ) {
416 item->initColor ();
417 item->updateItem();
418 }
419 }
420}
412bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) 421bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me)
413{ 422{
414 static int startX = 0; 423 static int startX = 0;
415 static int startY = 0; 424 static int startY = 0;
416 int blockmoveDist = ( QApplication::desktop()->width() < 480 ? 7 : 9 ); 425 int blockmoveDist = ( QApplication::desktop()->width() < 480 ? 7 : 9 );
417 static bool blockMoving = true; 426 static bool blockMoving = true;
418 427
419 //qDebug("KOAgenda::eventFilter_mous "); 428 //qDebug("KOAgenda::eventFilter_mous ");
420 if ( object == mNewItemPopup ) { 429 if ( object == mNewItemPopup ) {
421 //qDebug("mNewItemPopup "); 430 //qDebug("mNewItemPopup ");
422 if ( me->type() == QEvent::MouseButtonRelease ) { 431 if ( me->type() == QEvent::MouseButtonRelease ) {
423 mNewItemPopup->removeEventFilter( this ); 432 mNewItemPopup->removeEventFilter( this );
424 int dX = me->globalPos().x() - mPopupPos.x();; 433 int dX = me->globalPos().x() - mPopupPos.x();;
425 if ( dX < 0 ) 434 if ( dX < 0 )
426 dX = -dX; 435 dX = -dX;
427 int dY = me->globalPos().y() - mPopupPos.y(); 436 int dY = me->globalPos().y() - mPopupPos.y();
428 if ( dY < 0 ) 437 if ( dY < 0 )
429 dY = -dY; 438 dY = -dY;
430 if ( dX > blockmoveDist || dY > blockmoveDist ) { 439 if ( dX > blockmoveDist || dY > blockmoveDist ) {
431 mNewItemPopup->hide(); 440 mNewItemPopup->hide();
432 } 441 }
433 } 442 }
434 return true; 443 return true;
435 } 444 }