author | zautrix <zautrix> | 2005-04-01 13:07:01 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-04-01 13:07:01 (UTC) |
commit | 93003b1f8348f112648d3cc20acb21b062220e21 (patch) (side-by-side diff) | |
tree | 901bebe154a15f05296158db5da3689b849e8281 /korganizer | |
parent | f8e027db1d950ec27a3c47fc2a5ea2fe49ae9772 (diff) | |
download | kdepimpi-93003b1f8348f112648d3cc20acb21b062220e21.zip kdepimpi-93003b1f8348f112648d3cc20acb21b062220e21.tar.gz kdepimpi-93003b1f8348f112648d3cc20acb21b062220e21.tar.bz2 |
fixes
-rw-r--r-- | korganizer/kolistview.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index 09d70f1..15e094d 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp @@ -1026,217 +1026,217 @@ void KOListView::clear() Incidence* KOListView::currentItem() { if ( mListView->currentItem() ) return ((KOListViewItem*) mListView->currentItem())->data(); return 0; } void KOListView::keyPressEvent ( QKeyEvent *e) { if ( e->key() == Qt::Key_Delete || e->key() == Qt::Key_Backspace ) { deleteAll(); return; } e->ignore(); } void KOListViewListView::keyPressEvent ( QKeyEvent *e) { switch ( e->key() ) { case Qt::Key_Down: if ( e->state() == ShiftButton ) { QListViewItem* cn = currentItem(); if ( !cn ) cn = firstChild(); if ( !cn ) return; while ( cn->nextSibling() ) cn = cn->nextSibling(); setCurrentItem ( cn ); ensureItemVisible ( cn ); e->accept(); return; } if ( e->state() == ControlButton ) { int count = childCount (); int jump = count / 5; QListViewItem* cn; cn = currentItem(); if ( ! cn ) return; if ( jump == 0 ) jump = 1; while ( jump && cn->nextSibling() ) { cn = cn->nextSibling(); --jump; } setCurrentItem ( cn ); ensureItemVisible ( cn ); } else QListView::keyPressEvent ( e ) ; e->accept(); break; case Qt::Key_Up: if ( e->state() == ShiftButton ) { QListViewItem* cn = firstChild(); if ( cn ) { setCurrentItem ( cn ); ensureItemVisible ( cn ); } e->accept(); return; } if ( e->state() == ControlButton ) { int count = childCount (); int jump = count / 5; QListViewItem* cn; cn = currentItem(); if ( ! cn ) return; if ( jump == 0 ) jump = 1; while ( jump && cn->itemAbove ()) { cn = cn->itemAbove (); --jump; } setCurrentItem ( cn ); ensureItemVisible ( cn ); } else QListView::keyPressEvent ( e ) ; e->accept(); break; case Qt::Key_I: { QListViewItem* cn; cn = currentItem(); if ( cn ) { KOListViewItem* ci = (KOListViewItem*)( cn ); if ( ci ){ //emit showIncidence( ci->data()); cn = cn->nextSibling(); if ( cn ) { setCurrentItem ( cn ); ensureItemVisible ( cn ); } emit showIncidence( ci->data()); } } e->accept(); } break; case Qt::Key_Return: case Qt::Key_Enter: { QListViewItem* cn; cn = currentItem(); if ( cn ) { KOListViewItem* ci = (KOListViewItem*)( cn ); if ( ci ){ if ( e->state() == ShiftButton ) ci->setSelected( false ); else ci->setSelected( true ); cn = cn->nextSibling(); if ( cn ) { setCurrentItem ( cn ); ensureItemVisible ( cn ); } } } e->accept(); } break; default: e->ignore(); } } KOListViewListView::KOListViewListView(KOListView * lv ) : KListView( lv, "kolistlistview", false ) { mPopupTimer = new QTimer(this); connect(mPopupTimer , SIGNAL(timeout()), this, SLOT(popupMenu())); #ifndef DESKTOP_VERSION //QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold ); #endif setSelectionMode( QListView::Multi ); setMultiSelection( true); } void KOListViewListView::contentsMouseDoubleClickEvent(QMouseEvent *e) { if (!e) return; QPoint vp = contentsToViewport(e->pos()); QListViewItem *item = itemAt(vp); if (!item) { emit newEvent(); return; } KListView::contentsMouseDoubleClickEvent(e); } #if 0 void KOListViewListView::contentsMousePressEvent(QMouseEvent *e) { //qDebug("contentsMousePressEvent++++ "); KListView::contentsMousePressEvent( e ); if ( e->button() == RightButton ) { QListViewItem* ci = currentItem(); clearSelection () ; if ( ci ) ci->setSelected( true ); } } void KOListViewListView::contentsMouseReleaseEvent(QMouseEvent *e) { KListView::contentsMouseReleaseEvent(e); } void KOListViewListView::contentsMouseMoveEvent(QMouseEvent *e) { KListView::contentsMouseMoveEvent(e); } #endif void KOListViewListView::popupMenu() { mPopupTimer->stop(); //qDebug("HUUUUUUUUUUUUUUUUUUUU "); QMouseEvent* e = new QMouseEvent( QEvent::MouseButtonPress, mEventPos ,mEventGlobalPos, RightButton , RightButton ); QApplication::postEvent( this->viewport(), e ); } void KOListViewListView::contentsMousePressEvent(QMouseEvent *e) { //qDebug("contentsMousePressEvent++++ "); mYMousePos = mapToGlobal( (e->pos())).y(); if ( e->button() == LeftButton ) { mPopupTimer->start( 600 ); mEventPos = e->pos(); mEventGlobalPos = e->globalPos(); } KListView::contentsMousePressEvent( e ); if ( e->button() == RightButton ) { QListViewItem* ci = currentItem(); - clearSelection(); + //clearSelection(); if ( ci ) ci->setSelected( true ); } } void KOListViewListView::contentsMouseReleaseEvent(QMouseEvent *e) { mPopupTimer->stop(); KListView::contentsMouseReleaseEvent(e); } 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 > 15 ) mPopupTimer->stop(); else { mEventPos = e->pos(); mEventGlobalPos = e->globalPos(); } KListView::contentsMouseMoveEvent(e); } |