author | zautrix <zautrix> | 2005-03-10 10:40:57 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-10 10:40:57 (UTC) |
commit | b96161e4dd7fc19eea87257c2455b85420dad35a (patch) (side-by-side diff) | |
tree | d2e518cdc4c6c314f6e42960d12653ad6c7083d3 | |
parent | 4b05d69b961309df5d56714889c62ca530580914 (diff) | |
download | kdepimpi-b96161e4dd7fc19eea87257c2455b85420dad35a.zip kdepimpi-b96161e4dd7fc19eea87257c2455b85420dad35a.tar.gz kdepimpi-b96161e4dd7fc19eea87257c2455b85420dad35a.tar.bz2 |
todo month view fix
-rw-r--r-- | bin/kdepim/WhatsNew.txt | 2 | ||||
-rw-r--r-- | korganizer/komonthview.cpp | 30 | ||||
-rw-r--r-- | korganizer/komonthview.h | 5 |
3 files changed, 34 insertions, 3 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index d4b7971..95a1866 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt @@ -13,8 +13,10 @@ KO/Pi-KA/Pi: Changed "ME" menu bar entry to an icon. KO/Pi: Fixed two minor bugs in displaying todos. +If in month view a cell is selected, the key shortcut "d" shows now that date. +Added complete info for a todo in month view as an icon left of the text. ********** VERSION 2.0.14 ************ diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index f983ff9..4bf9dea 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp @@ -276,8 +276,24 @@ void MonthViewItem::paint(QPainter *p) } x += sizeM/2 + 1; x += sizeM + 1; } + + if ( mIncidence->type() == "Todo" ){ + Todo* td = ( Todo* ) mIncidence; + if ( td->isCompleted() ) { + int half = size/2; + p->drawLine ( x, heihei/2, x +half , heihei/2 +half ) ; + p->drawLine ( x +half , heihei/2 +half , x +half+half +2 , heihei/2 -2 ) ; + x += half+half + 4; + + } else { + int val = td->percentComplete()/20; + p->fillRect ( x+1, y-1, val ,size+2,Qt::black ); + p->drawRect ( x, y-1,7,size+2); + x += size + 3; + } + } QFontMetrics fm = p->fontMetrics(); int yPos; int pmheight = size; if( pmheight < fm.height() ) @@ -601,9 +617,9 @@ void MonthViewCell::insertTodo(Todo *todo) text += KGlobal::locale()->formatTime(todo->dtDue().time()); text += " "; } } - text += i18n("T: %1").arg(todo->summary()); + text += todo->summary(); MonthViewItem *item = new MonthViewItem( todo, mDate, text ); //item->setPalette( mStandardPalette ); QPalette pal; @@ -660,9 +676,9 @@ void MonthViewCell::finishUpdateCell() resizeEvent( 0 ); } void MonthViewCell::updateCell() { - qDebug("MonthViewCell::updateCell() "); + //qDebug("MonthViewCell::updateCell() "); if ( !mMonthView->isUpdatePossible() ) return; startUpdateCell(); //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2); @@ -1217,8 +1233,9 @@ void KOMonthView::updateView() if ( !updatePossible ) return; //QTime ti; //ti.start(); + clearSelection(); QPtrVector<MonthViewCell> *cells; if ( mShowWeekView ) { cells = &mCellsW; } else { @@ -1614,8 +1631,9 @@ void KOMonthView::processSelectionChange() if (incidences.count() > 0) { emit incidenceSelected( incidences.first() ); } else { emit incidenceSelected( 0 ); + clearSelection(); } } void KOMonthView::clearSelection() @@ -1662,8 +1680,16 @@ void KOMonthView::keyPressEvent ( QKeyEvent * e ) selectInternalWeekNum ( currentWeek() ); } e->accept(); break; + case Key_D: + if ( mSelectedCell ) { + mSelectedCell->showDay(); + e->accept(); + } else { + e->ignore(); + } + break; default: e->ignore(); break; } diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h index f92a69a..fd8cbf2 100644 --- a/korganizer/komonthview.h +++ b/korganizer/komonthview.h @@ -169,15 +169,18 @@ class MonthViewCell : public QWidget protected: QString mToolTip; void resizeEvent( QResizeEvent * ); + +public slots: + void showDay(); + protected slots: void defaultAction( QListBoxItem * ); void contextMenu( QListBoxItem * ); void selection( QListBoxItem * ); void cellClicked( QListBoxItem * ); void newEvent(); - void showDay(); private: KOMonthView *mMonthView; |