summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-06-28 09:52:05 (UTC)
committer zautrix <zautrix>2005-06-28 09:52:05 (UTC)
commitc26c9e0aa8c8a3b1d3e8dba018d56dbdb67c65b4 (patch) (unidiff)
tree432c39b8c65277964b9e62ee98eeeb92e3006ba2 /korganizer
parent4385e73c51688f0b8b21bfe061c04a6c42e92701 (diff)
downloadkdepimpi-c26c9e0aa8c8a3b1d3e8dba018d56dbdb67c65b4.zip
kdepimpi-c26c9e0aa8c8a3b1d3e8dba018d56dbdb67c65b4.tar.gz
kdepimpi-c26c9e0aa8c8a3b1d3e8dba018d56dbdb67c65b4.tar.bz2
fixes
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/komonthview.cpp65
-rw-r--r--korganizer/komonthview.h4
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
@@ -371,8 +371,22 @@ void MonthViewItem::paint(QPainter *p)
371 } 371 }
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 ) {
374 int yyy = y+(size/2); 388 int yyy = y+(size/2);
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 ) ;
378 if ( mMultiday == 2 || mMultiday == 3 ) { 392 if ( mMultiday == 2 || mMultiday == 3 ) {
@@ -413,5 +427,5 @@ void MonthViewItem::paint(QPainter *p)
413 } else { 427 } else {
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);
417 x += size + 3; 431 x += size + 3;
@@ -425,6 +439,5 @@ void MonthViewItem::paint(QPainter *p)
425 else 439 else
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) {
430 p->drawText( x, yPos, text() ); 443 p->drawText( x, yPos, text() );
@@ -618,5 +631,5 @@ void MonthViewCell::setHoliday( const QString &holiday )
618void MonthViewCell::startUpdateCell() 631void MonthViewCell::startUpdateCell()
619{ 632{
620 633 blockSignals( true );
621 mdayCount = 0; 634 mdayCount = 0;
622 setFocusPolicy(NoFocus); 635 setFocusPolicy(NoFocus);
@@ -882,4 +895,5 @@ void MonthViewCell::repaintfinishUpdateCell()
882 mitem = (MonthViewItem *)mitem->next(); 895 mitem = (MonthViewItem *)mitem->next();
883 } 896 }
897 blockSignals( false );
884} 898}
885void MonthViewCell::finishUpdateCell() 899void MonthViewCell::finishUpdateCell()
@@ -1027,13 +1041,12 @@ void MonthViewCell::resizeEvent ( QResizeEvent * e )
1027 1041
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 }
1039 mLabel->setText( text ); 1052 mLabel->setText( text );
@@ -1338,5 +1351,4 @@ KOMonthView::~KOMonthView()
1338void KOMonthView::incidenceHighlighted( Incidence * inc , MonthViewCell* mc, int mday ) 1351void KOMonthView::incidenceHighlighted( Incidence * inc , MonthViewCell* mc, int mday )
1339{ 1352{
1340 qDebug("11 KOMonthView::incidenceHighlighted %d %d %d", inc, mc, mday );
1341 static Incidence * lastInc = 0; 1353 static Incidence * lastInc = 0;
1342 static MonthViewCell * lastCell = 0; 1354 static MonthViewCell * lastCell = 0;
@@ -1346,5 +1358,5 @@ void KOMonthView::incidenceHighlighted( Incidence * inc , MonthViewCell* mc, int
1346 lastInc = inc; 1358 lastInc = inc;
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
1350 bool weekview = false; 1362 bool weekview = false;
@@ -1370,8 +1382,33 @@ void KOMonthView::incidenceHighlighted( Incidence * inc , MonthViewCell* mc, int
1370 } 1382 }
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 }
1374 if ( ! inc ) 1386 if ( ! inc )
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 )
1377 for (int i = index-1; i >= 0; --i) { 1414 for (int i = index-1; i >= 0; --i) {
@@ -1385,4 +1422,5 @@ void KOMonthView::incidenceHighlighted( Incidence * inc , MonthViewCell* mc, int
1385 break; 1422 break;
1386 } 1423 }
1424#endif
1387 1425
1388} 1426}
@@ -1722,5 +1760,6 @@ void KOMonthView::updateView()
1722 //qApp->processEvents(); 1760 //qApp->processEvents();
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 }
1726 setKeyBFocus(); 1765 setKeyBFocus();
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h
index 0f3aa54..0bd6b1c 100644
--- a/korganizer/komonthview.h
+++ b/korganizer/komonthview.h
@@ -168,5 +168,4 @@ class MonthViewCell : public KNoScrollListBox
168 void startUpdateCell(); 168 void startUpdateCell();
169 void finishUpdateCell(); 169 void finishUpdateCell();
170 void repaintfinishUpdateCell();
171 int insertEvent(Event *); 170 int insertEvent(Event *);
172 void insertTodo(Todo *); 171 void insertTodo(Todo *);
@@ -179,5 +178,4 @@ class MonthViewCell : public KNoScrollListBox
179 QDate selectedIncidenceDate(); 178 QDate selectedIncidenceDate();
180 QPushButton * dateLabel() { return mLabel; } 179 QPushButton * dateLabel() { return mLabel; }
181 void deHighLight();
182 bool doHighLight( Incidence *); 180 bool doHighLight( Incidence *);
183 void deselect(); 181 void deselect();
@@ -197,4 +195,6 @@ class MonthViewCell : public KNoScrollListBox
197public slots: 195public slots:
198 void showDay(); 196 void showDay();
197 void deHighLight();
198 void repaintfinishUpdateCell();
199 protected slots: 199 protected slots:
200 void defaultAction( QListBoxItem * ); 200 void defaultAction( QListBoxItem * );