-rw-r--r-- | korganizer/komonthview.cpp | 65 | ||||
-rw-r--r-- | korganizer/komonthview.h | 4 |
2 files changed, 54 insertions, 15 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 1c2d6a2..264cf28 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp | |||
@@ -372,2 +372,16 @@ void MonthViewItem::paint(QPainter *p) | |||
372 | } | 372 | } |
373 | |||
374 | |||
375 | |||
376 | |||
377 | if ( sel ) p->setPen( Qt::white ); | ||
378 | else p->setPen( palette().color( QPalette::Normal,QColorGroup::Foreground ) ); | ||
379 | |||
380 | #if 0 | ||
381 | p->setPen( palette().color( QPalette::Normal, sel ? \ | ||
382 | QColorGroup::HighlightedText : QColorGroup::Foreground ) ); | ||
383 | #endif | ||
384 | QColor textColor = p->pen().color(); | ||
385 | |||
386 | |||
373 | if ( mMultiday ) { | 387 | if ( mMultiday ) { |
@@ -375,3 +389,3 @@ void MonthViewItem::paint(QPainter *p) | |||
375 | int sizeM = size+2; | 389 | int sizeM = size+2; |
376 | p->setBrush( QBrush( p->pen().color() ) ); | 390 | p->setBrush( QBrush( textColor ) ); |
377 | p->drawLine ( x+1, yyy, x +sizeM +sizeM/2-1, yyy ) ; | 391 | p->drawLine ( x+1, yyy, x +sizeM +sizeM/2-1, yyy ) ; |
@@ -414,3 +428,3 @@ void MonthViewItem::paint(QPainter *p) | |||
414 | int val = td->percentComplete()/20; | 428 | int val = td->percentComplete()/20; |
415 | p->fillRect ( x+1, y-2, val ,size+4,p->pen().color() ); | 429 | p->fillRect ( x+1, y-2, val ,size+4,textColor ); |
416 | p->drawRect ( x, y-2,7,size+4); | 430 | p->drawRect ( x, y-2,7,size+4); |
@@ -426,4 +440,3 @@ void MonthViewItem::paint(QPainter *p) | |||
426 | yPos = pmheight/2 - fm.height()/2 + fm.ascent(); | 440 | yPos = pmheight/2 - fm.height()/2 + fm.ascent(); |
427 | p->setPen( palette().color( QPalette::Normal, sel ? \ | 441 | |
428 | QColorGroup::HighlightedText : QColorGroup::Foreground ) ); | ||
429 | if ( KOPrefs::instance()->mMonthShowTimes || isWeekItem) { | 442 | if ( KOPrefs::instance()->mMonthShowTimes || isWeekItem) { |
@@ -619,3 +632,3 @@ void MonthViewCell::startUpdateCell() | |||
619 | { | 632 | { |
620 | 633 | blockSignals( true ); | |
621 | mdayCount = 0; | 634 | mdayCount = 0; |
@@ -883,2 +896,3 @@ void MonthViewCell::repaintfinishUpdateCell() | |||
883 | } | 896 | } |
897 | blockSignals( false ); | ||
884 | } | 898 | } |
@@ -1028,11 +1042,10 @@ void MonthViewCell::resizeEvent ( QResizeEvent * e ) | |||
1028 | QString text; | 1042 | QString text; |
1029 | mLabel->setText( text ); | 1043 | //mLabel->setText( text ); |
1030 | bool smallDisplay = QApplication::desktop()->width() < 320 && KOPrefs::instance()->mMonthViewSatSunTog; | 1044 | bool smallDisplay = QApplication::desktop()->width() < 320 && KOPrefs::instance()->mMonthViewSatSunTog; |
1031 | if ( KOPrefs::instance()->mMonthViewWeek || KOGlobals::self()->calendarSystem()->day( mDate ) == 1 || (mDate.dayOfWeek() == 7 && !smallDisplay ) || KOPrefs::instance()->mMonthShowShort) { | 1045 | if ( KOPrefs::instance()->mMonthViewWeek || KOGlobals::self()->calendarSystem()->day( mDate ) == 1 || (mDate.dayOfWeek() == 7 && !smallDisplay ) || KOPrefs::instance()->mMonthShowShort) { |
1032 | text = KOGlobals::self()->calendarSystem()->monthName( mDate, true ) + " "; | 1046 | text = KOGlobals::self()->calendarSystem()->monthName( mDate, true ) + " " + QString::number( mDate.day() ); |
1033 | mLabel->resize( mLabelBigSize ); | 1047 | mLabel->resize( mLabelBigSize ); |
1034 | text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) ); | ||
1035 | } else { | 1048 | } else { |
1036 | mLabel->resize( mLabelSize ); | 1049 | mLabel->resize( mLabelSize ); |
1037 | text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) ); | 1050 | text = QString::number( mDate.day() ); |
1038 | } | 1051 | } |
@@ -1339,3 +1352,2 @@ void KOMonthView::incidenceHighlighted( Incidence * inc , MonthViewCell* mc, int | |||
1339 | { | 1352 | { |
1340 | qDebug("11 KOMonthView::incidenceHighlighted %d %d %d", inc, mc, mday ); | ||
1341 | static Incidence * lastInc = 0; | 1353 | static Incidence * lastInc = 0; |
@@ -1347,3 +1359,3 @@ void KOMonthView::incidenceHighlighted( Incidence * inc , MonthViewCell* mc, int | |||
1347 | lastCell = mc; | 1359 | lastCell = mc; |
1348 | qDebug("222 KOMonthView::incidenceHighlighted %d %d %d", inc, mc, mday ); | 1360 | //qDebug("KOMonthView::incidenceHighlighted %d %d %d", inc, mc, mday ); |
1349 | 1361 | ||
@@ -1371,3 +1383,3 @@ void KOMonthView::incidenceHighlighted( Incidence * inc , MonthViewCell* mc, int | |||
1371 | for (uint i = 0; i < (*cells).count(); ++i) { | 1383 | for (uint i = 0; i < (*cells).count(); ++i) { |
1372 | (*cells)[i]->deHighLight(); | 1384 | (*cells)[i]->deHighLight(); |
1373 | } | 1385 | } |
@@ -1375,2 +1387,27 @@ void KOMonthView::incidenceHighlighted( Incidence * inc , MonthViewCell* mc, int | |||
1375 | return; | 1387 | return; |
1388 | |||
1389 | int count = (*cells).count(); | ||
1390 | bool goLeft = (mday > 1 && index > 0); | ||
1391 | bool goRight = (mday < 3 && mday > 0 && index < count -1); | ||
1392 | for (uint iii = 1; iii < count; ++iii) { | ||
1393 | if ( goLeft ) { | ||
1394 | int left = index - iii; | ||
1395 | if ( left >= 0 ) { | ||
1396 | if ( (*cells)[(uint)left]->doHighLight(inc) ) | ||
1397 | goLeft = false; | ||
1398 | } else | ||
1399 | goLeft = false; | ||
1400 | } | ||
1401 | if ( goRight ) { | ||
1402 | int right = index + iii; | ||
1403 | if ( right < count ) { | ||
1404 | if ( (*cells)[right]->doHighLight(inc) ) | ||
1405 | goRight = false; | ||
1406 | |||
1407 | } else | ||
1408 | goRight = false; | ||
1409 | } | ||
1410 | |||
1411 | } | ||
1412 | #if 0 | ||
1376 | if ( mday > 1 && index > 0 ) | 1413 | if ( mday > 1 && index > 0 ) |
@@ -1386,2 +1423,3 @@ void KOMonthView::incidenceHighlighted( Incidence * inc , MonthViewCell* mc, int | |||
1386 | } | 1423 | } |
1424 | #endif | ||
1387 | 1425 | ||
@@ -1723,3 +1761,4 @@ void KOMonthView::updateView() | |||
1723 | for( i = 0; i < timeSpan+1; ++i ) { | 1761 | for( i = 0; i < timeSpan+1; ++i ) { |
1724 | (*cells)[i]->repaintfinishUpdateCell(); | 1762 | //(*cells)[i]->repaintfinishUpdateCell(); |
1763 | QTimer::singleShot( 0, (*cells)[i], SLOT ( repaintfinishUpdateCell() ) ); | ||
1725 | } | 1764 | } |
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h index 0f3aa54..0bd6b1c 100644 --- a/korganizer/komonthview.h +++ b/korganizer/komonthview.h | |||
@@ -169,3 +169,2 @@ class MonthViewCell : public KNoScrollListBox | |||
169 | void finishUpdateCell(); | 169 | void finishUpdateCell(); |
170 | void repaintfinishUpdateCell(); | ||
171 | int insertEvent(Event *); | 170 | int insertEvent(Event *); |
@@ -180,3 +179,2 @@ class MonthViewCell : public KNoScrollListBox | |||
180 | QPushButton * dateLabel() { return mLabel; } | 179 | QPushButton * dateLabel() { return mLabel; } |
181 | void deHighLight(); | ||
182 | bool doHighLight( Incidence *); | 180 | bool doHighLight( Incidence *); |
@@ -198,2 +196,4 @@ public slots: | |||
198 | void showDay(); | 196 | void showDay(); |
197 | void deHighLight(); | ||
198 | void repaintfinishUpdateCell(); | ||
199 | protected slots: | 199 | protected slots: |