From ad409bf71ce6c3733f9e5ae4e4aa38765329d7d8 Mon Sep 17 00:00:00 2001 From: zautrix Date: Sun, 10 Oct 2004 20:52:35 +0000 Subject: todo list fixes --- (limited to 'korganizer') diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 0c35bb3..1f2c6da 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -310,7 +310,7 @@ void CalendarView::init() // mDateNavigator->blockSignals( true ); leftFrameLayout->addWidget( mDateNavigator ); mFilterView = new KOFilterView(&mFilters,leftFrame,"CalendarView::FilterView"); - mTodoList = new KOTodoView(mCalendar, leftFrame, "todolist"); + mTodoList = new KOTodoView(mCalendar, leftFrame, "todolistsmall"); if ( QApplication::desktop()->width() < 480 ) { leftFrameLayout->addWidget(mFilterView); diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index da46eca..ca5eadd 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp @@ -57,6 +57,7 @@ KOTodoListView::KOTodoListView(Calendar *calendar,QWidget *parent, const char *name) : KListView(parent,name) { + mName = QString ( name ); mCalendar = calendar; #ifndef DESKTOP_VERSION QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold ); @@ -264,12 +265,16 @@ void KOTodoListView::keyPressEvent ( QKeyEvent * e ) } // qDebug("KOTodoListView::keyPressEvent "); - if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton || ( height() > 150 && width() > 200 ) ) { + if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton || mName != "todolistsmall" ) { switch ( e->key() ) { case Qt::Key_Down: case Qt::Key_Up: QListView::keyPressEvent ( e ); - break; + break; + case Qt::Key_Left: + case Qt::Key_Right: + QListView::keyPressEvent ( e ); + break; default: e->ignore(); break; @@ -332,7 +337,7 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : if ( !KOPrefs::instance()->mEnableQuickTodo ) mQuickAdd->hide(); - mTodoListView = new KOTodoListView(calendar,this); + mTodoListView = new KOTodoListView(calendar,this, name ); topLayout->addWidget(mTodoListView); //mTodoListView->header()->setMaximumHeight(30); mTodoListView->setRootIsDecorated(true); @@ -971,12 +976,10 @@ void KOTodoView::keyPressEvent ( QKeyEvent * e ) //return; switch ( e->key() ) { case Qt::Key_Down: - QWidget::keyPressEvent ( e ); - break; - case Qt::Key_Up: QWidget::keyPressEvent ( e ); break; + case Qt::Key_Q: toggleQuickTodo(); break; @@ -985,7 +988,7 @@ void KOTodoView::keyPressEvent ( QKeyEvent * e ) e->ignore(); } - if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton || ( height() > 150 && width() > 200 ) ) { + if ( true ) { if ( e->key() == Qt::Key_I ) { KOTodoViewItem*cn = (KOTodoViewItem*)mTodoListView->currentItem(); if ( cn ) { @@ -1001,7 +1004,7 @@ void KOTodoView::keyPressEvent ( QKeyEvent * e ) } } - e->accept(); + e->accept(); } diff --git a/korganizer/kotodoview.h b/korganizer/kotodoview.h index 4495702..6bf0203 100644 --- a/korganizer/kotodoview.h +++ b/korganizer/kotodoview.h @@ -74,6 +74,7 @@ class KOTodoListView : public KListView void contentsMouseDoubleClickEvent(QMouseEvent *); private: + QString mName; Calendar *mCalendar; QPoint mPressPos; bool mMousePressed; -- cgit v0.9.0.2