-rw-r--r-- | korganizer/komonthview.cpp | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index f983ff9..4bf9dea 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp @@ -278,4 +278,20 @@ void MonthViewItem::paint(QPainter *p) 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; @@ -603,5 +619,5 @@ void MonthViewCell::insertTodo(Todo *todo) } } - text += i18n("T: %1").arg(todo->summary()); + text += todo->summary(); MonthViewItem *item = new MonthViewItem( todo, mDate, text ); @@ -662,5 +678,5 @@ void MonthViewCell::finishUpdateCell() void MonthViewCell::updateCell() { - qDebug("MonthViewCell::updateCell() "); + //qDebug("MonthViewCell::updateCell() "); if ( !mMonthView->isUpdatePossible() ) return; @@ -1219,4 +1235,5 @@ void KOMonthView::updateView() //QTime ti; //ti.start(); + clearSelection(); QPtrVector<MonthViewCell> *cells; if ( mShowWeekView ) { @@ -1594,5 +1611,5 @@ MonthViewCell * KOMonthView::selectedCell( ) void KOMonthView::setSelectedCell( MonthViewCell *cell ) { - // qDebug("KOMonthView::setSelectedCell "); + //qDebug("KOMonthView::setSelectedCell "); if ( mSelectedCell && mSelectedCell != cell ) { MonthViewCell * mvc = mSelectedCell; @@ -1616,4 +1633,5 @@ void KOMonthView::processSelectionChange() } else { emit incidenceSelected( 0 ); + clearSelection(); } } @@ -1664,4 +1682,12 @@ void KOMonthView::keyPressEvent ( QKeyEvent * e ) e->accept(); break; + case Key_D: + if ( mSelectedCell ) { + mSelectedCell->showDay(); + e->accept(); + } else { + e->ignore(); + } + break; default: e->ignore(); |