summaryrefslogtreecommitdiffabout
path: root/korganizer/kodaymatrix.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/kodaymatrix.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/kodaymatrix.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp
index d543aaf..dfc6af7 100644
--- a/korganizer/kodaymatrix.cpp
+++ b/korganizer/kodaymatrix.cpp
@@ -109,8 +109,9 @@ KODayMatrix::KODayMatrix( QWidget *parent, const char *name )
KODayMatrix::KODayMatrix(QWidget *parent, Calendar* calendar, QDate date, const char *name) :
QFrame(parent, name)
#endif
{
+ mRedrawNeeded = true;
mKODaymatrixWhatsThis = new KODaymatrixWhatsThis(this);
mPendingUpdateBeforeRepaint = false;
mouseDown = false;
// initialize dynamic arrays
@@ -385,8 +386,9 @@ void KODayMatrix::updateViewTimed()
} else {
mHolidays[i] = QString::null;
}
}
+ mRedrawNeeded = true;
if ( ! mPendingUpdateBeforeRepaint )
repaint(false);
}
void KODayMatrix::updateView(QDate actdate)
@@ -419,17 +421,18 @@ void KODayMatrix::updateView(QDate actdate)
}
startdate = actdate;
mDayChanged = true;
recalculateToday();
+ mRedrawNeeded = true;
}
//qDebug("restart Timer %d vis: %d", mDayChanged, isVisible() );
if ( !isVisible() ) {
mPendingUpdateBeforeRepaint = true;
} else {
#ifdef DESKTOP_VERSION
//mRepaintTimer->start( 100 );
//updateViewTimed();
- mUpdateTimer->start( 20 );
+ mUpdateTimer->start( 50 );
#else
mRepaintTimer->start( 350 );
mUpdateTimer->start( 1200 );
#endif
@@ -677,9 +680,13 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
mPendingUpdateBeforeRepaint = false;
}
if ( myPix.width() != width() || myPix.height()!=height() ) {
myPix.resize(size() );
+ mRedrawNeeded = true;
}
+
+ if ( mRedrawNeeded ) {
+ //qDebug("REDRAW ");
QPainter p(&myPix);
p.setFont(font());
@@ -926,11 +933,13 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
myFont.setBold(false);
p.setFont(myFont);
}
}
- int off = 0;//xyOff;
- bitBlt (this, off, off, &myPix, 0 ,0,width(), height() ,CopyROP);
- //qDebug("ffffffffff %d ", off);
+ } else {
+ //qDebug("NO redraw ");
+ }
+ bitBlt (this, 0, 0, &myPix, 0 ,0,width(), height() ,CopyROP);
+ mRedrawNeeded = false;
}
// ----------------------------------------------------------------------------
// R E SI Z E E V E N T H A N D L I N G