-rw-r--r-- | korganizer/koagenda.cpp | 2 | ||||
-rw-r--r-- | korganizer/koagendaitem.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp index dcb46a8..5420822 100644 --- a/korganizer/koagenda.cpp +++ b/korganizer/koagenda.cpp @@ -405,97 +405,97 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) case QEvent::MouseButtonPress: rightClickTime.restart(); if (me->button() == LeftButton) { leftMouseDown = true; } else if (me->button() == RightButton) rightMouseDown = true; blockMoving = true; startX = viewportPos.x(); startY = viewportPos.y(); if (object != viewport()) { if (me->button() == RightButton) { mClickedItem = (KOAgendaItem *)object; if (mClickedItem) { selectItem(mClickedItem); } } else if (me->button() == LeftButton) { mActionItem = (KOAgendaItem *)object; if (mActionItem) { if ( mSelectionHeight > 0 ) { int selectionCellX = mSelectionCellX * mGridSpacingX; int selectionYTop = mSelectionYTop; int gridSpacingX = mGridSpacingX; int selectionHeight = mSelectionHeight; clearSelection(); repaintContents( selectionCellX, selectionYTop, gridSpacingX, selectionHeight,false ); } selectItem(mActionItem); Incidence *incidence = mActionItem->incidence(); if ( incidence->isReadOnly() /*|| incidence->recurrence()->doesRecur() */) { mActionItem = 0; } else { startItemAction(viewportPos); } } } } else { // ---------- viewport() selectItem(0); mActionItem = 0; if (me->button() == LeftButton ) { setCursor(arrowCursor); startSelectAction(viewportPos); } } break; case QEvent::MouseButtonRelease: - if ( rightClickTime.elapsed() > 700 && blockMoving ) + if ( rightClickTime.elapsed() > 500 && blockMoving ) rightButtonPressed = true; if (object != viewport()) { if (me->button() == RightButton || rightButtonPressed ) { if ( blockMoving ) { mClickedItem = (KOAgendaItem *)object; if (mActionItem ) { endItemAction(); } leftMouseDown = false; // no more leftMouse computation if (mClickedItem) { selectItem(mClickedItem); emit showIncidencePopupSignal(mClickedItem->incidence()); } } } else if (me->button() == LeftButton && leftMouseDown) { if (mActionItem) { QPoint clipperPos = clipper()->mapFromGlobal(viewport()->mapToGlobal(viewportPos)); //qDebug(" %d %d %d ",clipperPos.y(),visibleHeight() , 9 ); if ( mActionType == MOVE && (clipperPos.y() > visibleHeight()-2 ||clipperPos.y() < 0 ) ) { mScrollUpTimer.stop(); mScrollDownTimer.stop(); mActionItem->resetMove(); placeSubCells( mActionItem ); // emit startDragSignal( mActionItem->incidence() ); setCursor( arrowCursor ); mActionItem = 0; mActionType = NOP; mItemMoved = 0; leftMouseDown = false; return true; } endItemAction(); } } } else { // ---------- viewport() 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 } int x,y; viewportToContents(viewportPos.x(),viewportPos.y(),x,y); int gx,gy; contentsToGrid(x,y,gx,gy); mCurrentCellX = gx; mCurrentCellY = gy; diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp index 042a789..0ea2860 100644 --- a/korganizer/koagendaitem.cpp +++ b/korganizer/koagendaitem.cpp @@ -30,104 +30,104 @@ #include <kiconloader.h> #include <kdebug.h> #include <kglobal.h> #include <klocale.h> #ifndef DESKTOP_VERSION #include <qpe/qpeapplication.h> #define AGENDA_ICON_SIZE 5 #else #define AGENDA_ICON_SIZE 7 #endif #include <libkcal/icaldrag.h> #include <libkcal/vcaldrag.h> #include <libkcal/kincidenceformatter.h> extern int globalFlagBlockAgenda; extern int globalFlagBlockAgendaItemPaint; extern int globalFlagBlockAgendaItemUpdate; #include "koprefs.h" #include "koagendaitem.h" //#include "koagendaitem.moc" //-------------------------------------------------------------------------- QToolTipGroup *KOAgendaItem::mToolTipGroup = 0; //-------------------------------------------------------------------------- class KOAgendaItemWhatsThis :public QWhatsThis { public: KOAgendaItemWhatsThis( KOAgendaItem* view ) : QWhatsThis( view ),_view (view) { }; protected: virtual QString text( const QPoint& ) { return _view->getWhatsThisText() ; } private: KOAgendaItem * _view; }; KOAgendaItem::KOAgendaItem(Incidence *incidence, QDate qd, QWidget *parent,bool allday, const char *name,WFlags) : QWidget(parent, name), mIncidence(incidence), mDate(qd) { #ifndef DESKTOP_VERSION - QPEApplication::setStylusOperation( this, QPEApplication::RightOnHold ); + //QPEApplication::setStylusOperation( this, QPEApplication::RightOnHold ); #endif new KOAgendaItemWhatsThis(this); int wflags = getWFlags() |WRepaintNoErase;// WResizeNoErase setWFlags ( wflags); mAllDay = allday; init ( incidence, qd ); - setMouseTracking(true); + //setMouseTracking(true); //setAcceptDrops(true); xPaintCoord = -1; yPaintCoord = -1; } QString KOAgendaItem::getWhatsThisText() { if ( mIncidence ) return KIncidenceFormatter::instance()->getFormattedText( mIncidence, KOPrefs::instance()->mWTshowDetails, KOPrefs::instance()->mWTshowCreated, KOPrefs::instance()->mWTshowChanged); return "KOAgendaItem::getWhatsThisText()::internal error"; } void KOAgendaItem::init ( Incidence *incidence, QDate qd ) { mIncidence = incidence; mDate = qd; mFirstMultiItem = 0; mNextMultiItem = 0; mLastMultiItem = 0; computeText(); if ( (incidence->type() == "Todo") && ( !((static_cast<Todo*>(incidence))->isCompleted()) && ((static_cast<Todo*>(incidence))->dtDue().date() <= QDate::currentDate()) ) ) { if ( (static_cast<Todo*>(incidence))->dtDue() < QDateTime::currentDateTime().date()) mBackgroundColor = KOPrefs::instance()->mTodoOverdueColor ; else mBackgroundColor = KOPrefs::instance()->mTodoDueTodayColor; } else { QStringList categories = mIncidence->categories(); QString cat = categories.first(); if (cat.isEmpty()) { if ( (incidence->type() == "Todo") &&((static_cast<Todo*>(incidence))->isCompleted()) ) mBackgroundColor =KOPrefs::instance()->mTodoDoneColor; else mBackgroundColor =KOPrefs::instance()->mEventColor; } else { mBackgroundColor = *KOPrefs::instance()->categoryColor(cat); if ( (incidence->type() == "Todo") &&((static_cast<Todo*>(incidence))->isCompleted()) ) { if ( mBackgroundColor == KOPrefs::instance()->mEventColor ) mBackgroundColor =KOPrefs::instance()->mTodoDoneColor; } } } mColorGroup = QColorGroup( mBackgroundColor.light(), |