-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 | |||
@@ -277,6 +277,22 @@ void MonthViewItem::paint(QPainter *p) | |||
277 | x += sizeM/2 + 1; | 277 | x += sizeM/2 + 1; |
278 | x += sizeM + 1; | 278 | x += sizeM + 1; |
279 | } | 279 | } |
280 | |||
281 | if ( mIncidence->type() == "Todo" ){ | ||
282 | Todo* td = ( Todo* ) mIncidence; | ||
283 | if ( td->isCompleted() ) { | ||
284 | int half = size/2; | ||
285 | p->drawLine ( x, heihei/2, x +half , heihei/2 +half ) ; | ||
286 | p->drawLine ( x +half , heihei/2 +half , x +half+half +2 , heihei/2 -2 ) ; | ||
287 | x += half+half + 4; | ||
288 | |||
289 | } else { | ||
290 | int val = td->percentComplete()/20; | ||
291 | p->fillRect ( x+1, y-1, val ,size+2,Qt::black ); | ||
292 | p->drawRect ( x, y-1,7,size+2); | ||
293 | x += size + 3; | ||
294 | } | ||
295 | } | ||
280 | QFontMetrics fm = p->fontMetrics(); | 296 | QFontMetrics fm = p->fontMetrics(); |
281 | int yPos; | 297 | int yPos; |
282 | int pmheight = size; | 298 | int pmheight = size; |
@@ -602,7 +618,7 @@ void MonthViewCell::insertTodo(Todo *todo) | |||
602 | text += " "; | 618 | text += " "; |
603 | } | 619 | } |
604 | } | 620 | } |
605 | text += i18n("T: %1").arg(todo->summary()); | 621 | text += todo->summary(); |
606 | 622 | ||
607 | MonthViewItem *item = new MonthViewItem( todo, mDate, text ); | 623 | MonthViewItem *item = new MonthViewItem( todo, mDate, text ); |
608 | //item->setPalette( mStandardPalette ); | 624 | //item->setPalette( mStandardPalette ); |
@@ -661,7 +677,7 @@ void MonthViewCell::finishUpdateCell() | |||
661 | } | 677 | } |
662 | void MonthViewCell::updateCell() | 678 | void MonthViewCell::updateCell() |
663 | { | 679 | { |
664 | qDebug("MonthViewCell::updateCell() "); | 680 | //qDebug("MonthViewCell::updateCell() "); |
665 | if ( !mMonthView->isUpdatePossible() ) | 681 | if ( !mMonthView->isUpdatePossible() ) |
666 | return; | 682 | return; |
667 | startUpdateCell(); | 683 | startUpdateCell(); |
@@ -1218,6 +1234,7 @@ void KOMonthView::updateView() | |||
1218 | return; | 1234 | return; |
1219 | //QTime ti; | 1235 | //QTime ti; |
1220 | //ti.start(); | 1236 | //ti.start(); |
1237 | clearSelection(); | ||
1221 | QPtrVector<MonthViewCell> *cells; | 1238 | QPtrVector<MonthViewCell> *cells; |
1222 | if ( mShowWeekView ) { | 1239 | if ( mShowWeekView ) { |
1223 | cells = &mCellsW; | 1240 | cells = &mCellsW; |
@@ -1593,7 +1610,7 @@ MonthViewCell * KOMonthView::selectedCell( ) | |||
1593 | } | 1610 | } |
1594 | void KOMonthView::setSelectedCell( MonthViewCell *cell ) | 1611 | void KOMonthView::setSelectedCell( MonthViewCell *cell ) |
1595 | { | 1612 | { |
1596 | // qDebug("KOMonthView::setSelectedCell "); | 1613 | //qDebug("KOMonthView::setSelectedCell "); |
1597 | if ( mSelectedCell && mSelectedCell != cell ) { | 1614 | if ( mSelectedCell && mSelectedCell != cell ) { |
1598 | MonthViewCell * mvc = mSelectedCell; | 1615 | MonthViewCell * mvc = mSelectedCell; |
1599 | mSelectedCell = cell; | 1616 | mSelectedCell = cell; |
@@ -1615,6 +1632,7 @@ void KOMonthView::processSelectionChange() | |||
1615 | emit incidenceSelected( incidences.first() ); | 1632 | emit incidenceSelected( incidences.first() ); |
1616 | } else { | 1633 | } else { |
1617 | emit incidenceSelected( 0 ); | 1634 | emit incidenceSelected( 0 ); |
1635 | clearSelection(); | ||
1618 | } | 1636 | } |
1619 | } | 1637 | } |
1620 | 1638 | ||
@@ -1663,6 +1681,14 @@ void KOMonthView::keyPressEvent ( QKeyEvent * e ) | |||
1663 | } | 1681 | } |
1664 | e->accept(); | 1682 | e->accept(); |
1665 | break; | 1683 | break; |
1684 | case Key_D: | ||
1685 | if ( mSelectedCell ) { | ||
1686 | mSelectedCell->showDay(); | ||
1687 | e->accept(); | ||
1688 | } else { | ||
1689 | e->ignore(); | ||
1690 | } | ||
1691 | break; | ||
1666 | default: | 1692 | default: |
1667 | e->ignore(); | 1693 | e->ignore(); |
1668 | break; | 1694 | break; |