summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--korganizer/komonthview.cpp63
-rw-r--r--korganizer/komonthview.h4
2 files changed, 53 insertions, 14 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)
}
+
+
+
+
+ if ( sel ) p->setPen( Qt::white );
+ else p->setPen( palette().color( QPalette::Normal,QColorGroup::Foreground ) );
+
+#if 0
+ p->setPen( palette().color( QPalette::Normal, sel ? \
+ QColorGroup::HighlightedText : QColorGroup::Foreground ) );
+#endif
+ QColor textColor = p->pen().color();
+
+
if ( mMultiday ) {
@@ -375,3 +389,3 @@ void MonthViewItem::paint(QPainter *p)
int sizeM = size+2;
- p->setBrush( QBrush( p->pen().color() ) );
+ p->setBrush( QBrush( textColor ) );
p->drawLine ( x+1, yyy, x +sizeM +sizeM/2-1, yyy ) ;
@@ -414,3 +428,3 @@ void MonthViewItem::paint(QPainter *p)
int val = td->percentComplete()/20;
- p->fillRect ( x+1, y-2, val ,size+4,p->pen().color() );
+ p->fillRect ( x+1, y-2, val ,size+4,textColor );
p->drawRect ( x, y-2,7,size+4);
@@ -426,4 +440,3 @@ void MonthViewItem::paint(QPainter *p)
yPos = pmheight/2 - fm.height()/2 + fm.ascent();
- p->setPen( palette().color( QPalette::Normal, sel ? \
- QColorGroup::HighlightedText : QColorGroup::Foreground ) );
+
if ( KOPrefs::instance()->mMonthShowTimes || isWeekItem) {
@@ -619,3 +632,3 @@ void MonthViewCell::startUpdateCell()
{
-
+ blockSignals( true );
mdayCount = 0;
@@ -883,2 +896,3 @@ void MonthViewCell::repaintfinishUpdateCell()
}
+ blockSignals( false );
}
@@ -1028,11 +1042,10 @@ void MonthViewCell::resizeEvent ( QResizeEvent * e )
QString text;
- mLabel->setText( text );
+ //mLabel->setText( text );
bool smallDisplay = QApplication::desktop()->width() < 320 && KOPrefs::instance()->mMonthViewSatSunTog;
if ( KOPrefs::instance()->mMonthViewWeek || KOGlobals::self()->calendarSystem()->day( mDate ) == 1 || (mDate.dayOfWeek() == 7 && !smallDisplay ) || KOPrefs::instance()->mMonthShowShort) {
- text = KOGlobals::self()->calendarSystem()->monthName( mDate, true ) + " ";
+ text = KOGlobals::self()->calendarSystem()->monthName( mDate, true ) + " " + QString::number( mDate.day() );
mLabel->resize( mLabelBigSize );
- text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) );
} else {
mLabel->resize( mLabelSize );
- text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) );
+ text = QString::number( mDate.day() );
}
@@ -1339,3 +1352,2 @@ void KOMonthView::incidenceHighlighted( Incidence * inc , MonthViewCell* mc, int
{
- qDebug("11 KOMonthView::incidenceHighlighted %d %d %d", inc, mc, mday );
static Incidence * lastInc = 0;
@@ -1347,3 +1359,3 @@ void KOMonthView::incidenceHighlighted( Incidence * inc , MonthViewCell* mc, int
lastCell = mc;
- qDebug("222 KOMonthView::incidenceHighlighted %d %d %d", inc, mc, mday );
+ //qDebug("KOMonthView::incidenceHighlighted %d %d %d", inc, mc, mday );
@@ -1375,2 +1387,27 @@ void KOMonthView::incidenceHighlighted( Incidence * inc , MonthViewCell* mc, int
return;
+
+ int count = (*cells).count();
+ bool goLeft = (mday > 1 && index > 0);
+ bool goRight = (mday < 3 && mday > 0 && index < count -1);
+ for (uint iii = 1; iii < count; ++iii) {
+ if ( goLeft ) {
+ int left = index - iii;
+ if ( left >= 0 ) {
+ if ( (*cells)[(uint)left]->doHighLight(inc) )
+ goLeft = false;
+ } else
+ goLeft = false;
+ }
+ if ( goRight ) {
+ int right = index + iii;
+ if ( right < count ) {
+ if ( (*cells)[right]->doHighLight(inc) )
+ goRight = false;
+
+ } else
+ goRight = false;
+ }
+
+ }
+#if 0
if ( mday > 1 && index > 0 )
@@ -1386,2 +1423,3 @@ void KOMonthView::incidenceHighlighted( Incidence * inc , MonthViewCell* mc, int
}
+#endif
@@ -1723,3 +1761,4 @@ void KOMonthView::updateView()
for( i = 0; i < timeSpan+1; ++i ) {
- (*cells)[i]->repaintfinishUpdateCell();
+ //(*cells)[i]->repaintfinishUpdateCell();
+ QTimer::singleShot( 0, (*cells)[i], SLOT ( repaintfinishUpdateCell() ) );
}
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
void finishUpdateCell();
- void repaintfinishUpdateCell();
int insertEvent(Event *);
@@ -180,3 +179,2 @@ class MonthViewCell : public KNoScrollListBox
QPushButton * dateLabel() { return mLabel; }
- void deHighLight();
bool doHighLight( Incidence *);
@@ -198,2 +196,4 @@ public slots:
void showDay();
+ void deHighLight();
+ void repaintfinishUpdateCell();
protected slots: