author | zautrix <zautrix> | 2005-03-25 18:26:36 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-25 18:26:36 (UTC) |
commit | 89a72c007045dcfa5dbf57012b4cf0c2aebd1495 (patch) (side-by-side diff) | |
tree | 6accbe5706b724e307d1590152fa2d2c78cdef70 | |
parent | 3326831dbf6f962e97a978781361db5198f6a035 (diff) | |
download | kdepimpi-89a72c007045dcfa5dbf57012b4cf0c2aebd1495.zip kdepimpi-89a72c007045dcfa5dbf57012b4cf0c2aebd1495.tar.gz kdepimpi-89a72c007045dcfa5dbf57012b4cf0c2aebd1495.tar.bz2 |
layout fixes
-rw-r--r-- | korganizer/koagenda.cpp | 75 | ||||
-rw-r--r-- | korganizer/koagendaitem.cpp | 2 | ||||
-rw-r--r-- | korganizer/kolistview.cpp | 42 | ||||
-rw-r--r-- | korganizer/kolistview.h | 2 | ||||
-rw-r--r-- | korganizer/komonthview.cpp | 9 |
5 files changed, 44 insertions, 86 deletions
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp index 2820ca2..66ad4ec 100644 --- a/korganizer/koagenda.cpp +++ b/korganizer/koagenda.cpp @@ -177,3 +177,3 @@ KOAgenda::KOAgenda(int columns,int rows,int rowSize,QWidget *parent, #ifndef DESKTOP_VERSION - //QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold ); + QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold ); #endif @@ -400,4 +400,2 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) static bool leftMouseDown = false; - static bool rightMouseDown = false; - static QTime rightClickTime; bool rightButtonPressed = false; @@ -405,3 +403,2 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) case QEvent::MouseButtonPress: - rightClickTime.restart(); if (me->button() == LeftButton) { @@ -409,4 +406,5 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) } - else if (me->button() == RightButton) - rightMouseDown = true; + else if (me->button() == RightButton) { + leftMouseDown = false; + } blockMoving = true; @@ -414,8 +412,14 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) startY = viewportPos.y(); - if (object != viewport()) { + if (object != viewport()) { // item clicked ************** if (me->button() == RightButton) { + leftMouseDown = false; mClickedItem = (KOAgendaItem *)object; + if (mActionItem ) { + endItemAction(); + } if (mClickedItem) { selectItem(mClickedItem); + emit showIncidencePopupSignal(mClickedItem->incidence()); } + return true; } else if (me->button() == LeftButton) { @@ -447,2 +451,17 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) startSelectAction(viewportPos); + } else if (me->button() == RightButton ) { + setCursor(arrowCursor); + 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; + mStartCellX = gx; + mStartCellY = gy; + mNewItemPopup->popup( viewport()->mapToGlobal( me->pos() ) ); } @@ -452,18 +471,5 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) case QEvent::MouseButtonRelease: - 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 (me->button() == LeftButton && leftMouseDown) { if (mActionItem) { @@ -489,20 +495,3 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) } 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; - mStartCellX = gx; - mStartCellY = gy; - mNewItemPopup->popup( viewport()->mapToGlobal( me->pos() ) ); - } - } - else if (me->button() == LeftButton && leftMouseDown ) { //left click + if (me->button() == LeftButton && leftMouseDown ) { //left click endSelectAction( true ); // emit new event signal @@ -512,4 +501,3 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) leftMouseDown = false; - else if (me->button() == RightButton) - rightMouseDown = false; + break; @@ -517,3 +505,3 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) case QEvent::MouseMove: - if ( !rightMouseDown && !leftMouseDown ) + if ( !leftMouseDown ) return true; @@ -552,3 +540,2 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) leftMouseDown = false; - rightMouseDown = false; if (object == viewport()) { diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp index b30ad75..905c1bf 100644 --- a/korganizer/koagendaitem.cpp +++ b/korganizer/koagendaitem.cpp @@ -77,3 +77,3 @@ KOAgendaItem::KOAgendaItem(Incidence *incidence, QDate qd, QWidget *parent,bool #ifndef DESKTOP_VERSION - //QPEApplication::setStylusOperation( this, QPEApplication::RightOnHold ); + QPEApplication::setStylusOperation( this, QPEApplication::RightOnHold ); #endif diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index 3519985..6b63d7f 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp @@ -310,3 +310,3 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent, this,SLOT(defaultItemAction(QListViewItem *))); - QObject::connect(mListView,SIGNAL(rightButtonClicked ( QListViewItem *, + QObject::connect(mListView,SIGNAL(rightButtonPressed( QListViewItem *, const QPoint &, int )), @@ -1161,8 +1161,4 @@ KOListViewListView::KOListViewListView(KOListView * lv ) #endif - mYMousePos = -1000; setSelectionMode( QListView::Multi ); setMultiSelection( true); - mAllowPopupMenu = true; - mMouseDown = false; - } @@ -1180,3 +1176,2 @@ void KOListViewListView::contentsMouseDoubleClickEvent(QMouseEvent *e) - void KOListViewListView::contentsMousePressEvent(QMouseEvent *e) @@ -1184,30 +1179,6 @@ void KOListViewListView::contentsMousePressEvent(QMouseEvent *e) //qDebug("contentsMousePressEvent++++ "); - if (! mMouseDown ) { - mAllowPopupMenu = true; - mYMousePos = mapToGlobal( (e->pos())).y(); - } - if ( e->button() == RightButton && mMouseDown ) - return; - if ( e->button() == LeftButton ) - mMouseDown = true; KListView::contentsMousePressEvent( e ); -} -void KOListViewListView::contentsMouseReleaseEvent(QMouseEvent *e) -{ - //qDebug("contentsMouseReleaseEv---- "); - if ( ! mMouseDown ) { - if ( e->button() == RightButton && ! mAllowPopupMenu ) - return; - QListViewItem* ci = currentItem(); - if ( ci ) - ci->setSelected( true ); - KListView::contentsMouseReleaseEvent(e); - return; - } - if ( e->button() == LeftButton ) - mMouseDown = false; - if ( e->button() == RightButton && ! mAllowPopupMenu ) - return; if ( e->button() == RightButton ) { QListViewItem* ci = currentItem(); + clearSelection () ; if ( ci ) @@ -1215,2 +1186,5 @@ void KOListViewListView::contentsMouseReleaseEvent(QMouseEvent *e) } +} +void KOListViewListView::contentsMouseReleaseEvent(QMouseEvent *e) +{ KListView::contentsMouseReleaseEvent(e); @@ -1219,8 +1193,2 @@ void KOListViewListView::contentsMouseMoveEvent(QMouseEvent *e) { - // qDebug("contentsMouseMoveEv....... "); - // qDebug("start: %d current %d ",mYMousePos , mapToGlobal( (e->pos())).y() ); - int diff = mYMousePos - mapToGlobal( (e->pos())).y(); - if ( diff < 0 ) diff = -diff; - if ( diff > 20 ) - mAllowPopupMenu = false; KListView::contentsMouseMoveEvent(e); diff --git a/korganizer/kolistview.h b/korganizer/kolistview.h index 0d9c525..eca71e2 100644 --- a/korganizer/kolistview.h +++ b/korganizer/kolistview.h @@ -225,5 +225,3 @@ class KOListViewListView : public KListView void contentsMouseMoveEvent(QMouseEvent *e); - bool mAllowPopupMenu; bool mMouseDown; - int mYMousePos; }; diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 12233ee..9085775 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp @@ -516,2 +516,7 @@ void MonthViewCell::startUpdateCell() } + if ( mAvailItemList.count() > 20 ) { + mAvailItemList.setAutoDelete( true ); + mAvailItemList.clear(); + mAvailItemList.setAutoDelete( false ); + } /* @@ -819,3 +824,2 @@ void MonthViewCell::enableScrollBars( bool enabled ) if ( enabled ) { - QListBoxItem *fi = firstItem (); @@ -824,4 +828,5 @@ void MonthViewCell::enableScrollBars( bool enabled ) int hei = numRows () * ihei; - if ( hei < height() - horizontalScrollBar()->height () ) + if ( hei < height() - horizontalScrollBar()->height () ) { setVScrollBarMode(QScrollView::AlwaysOff); + } else |