summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--korganizer/koagendaview.cpp10
-rw-r--r--korganizer/koagendaview.h2
-rw-r--r--korganizer/kodaymatrix.cpp17
-rw-r--r--korganizer/kodaymatrix.h1
4 files changed, 26 insertions, 4 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index 2996acb..218396d 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -82,6 +82,8 @@ TimeLabels::TimeLabels(int rows,QWidget *parent,const char *name,WFlags f) :
QScrollView(parent,name,f)
{
+ myPix.resize( 1, 1 );
mRows = rows;
+ mRedrawNeeded = true;
setMinimumHeight( 20 );
mCellHeight = KOPrefs::instance()->mHourSize*4;
@@ -117,4 +119,5 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch)
// now, for a workaround...
// these two assignments fix the weird redraw bug
+ if ( mRedrawNeeded ) {
cx = contentsX() + 2;
cw = contentsWidth() - 2;
@@ -184,4 +187,10 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch)
cell++;
}
+ } else {
+ //qDebug("NO redraw ");
+ }
+ // double buffer not yet implemented
+ //bitBlt (this, 0, 0, &myPix, 0 ,0,width(), height() ,CopyROP);
+ //mRedrawNeeded = false;
}
@@ -197,4 +206,5 @@ int TimeLabels::minimumWidth() const
void TimeLabels::updateConfig()
{
+ mRedrawNeeded = true;
// set the font
// config->setGroup("Fonts");
diff --git a/korganizer/koagendaview.h b/korganizer/koagendaview.h
index 6dc81c6..30c9b05 100644
--- a/korganizer/koagendaview.h
+++ b/korganizer/koagendaview.h
@@ -102,4 +102,6 @@ class TimeLabels : public QScrollView {
private:
+ QPixmap myPix;
+ bool mRedrawNeeded;
int mMiniWidth;
int mMouseDownY;
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp
index d543aaf..dfc6af7 100644
--- a/korganizer/kodaymatrix.cpp
+++ b/korganizer/kodaymatrix.cpp
@@ -111,4 +111,5 @@ KODayMatrix::KODayMatrix(QWidget *parent, Calendar* calendar, QDate date, const
#endif
{
+ mRedrawNeeded = true;
mKODaymatrixWhatsThis = new KODaymatrixWhatsThis(this);
mPendingUpdateBeforeRepaint = false;
@@ -387,4 +388,5 @@ void KODayMatrix::updateViewTimed()
}
}
+ mRedrawNeeded = true;
if ( ! mPendingUpdateBeforeRepaint )
repaint(false);
@@ -421,4 +423,5 @@ void KODayMatrix::updateView(QDate actdate)
mDayChanged = true;
recalculateToday();
+ mRedrawNeeded = true;
}
//qDebug("restart Timer %d vis: %d", mDayChanged, isVisible() );
@@ -429,5 +432,5 @@ void KODayMatrix::updateView(QDate actdate)
//mRepaintTimer->start( 100 );
//updateViewTimed();
- mUpdateTimer->start( 20 );
+ mUpdateTimer->start( 50 );
#else
mRepaintTimer->start( 350 );
@@ -679,5 +682,9 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
if ( myPix.width() != width() || myPix.height()!=height() ) {
myPix.resize(size() );
+ mRedrawNeeded = true;
}
+
+ if ( mRedrawNeeded ) {
+ //qDebug("REDRAW ");
QPainter p(&myPix);
p.setFont(font());
@@ -928,7 +935,9 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
}
}
- 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;
}
diff --git a/korganizer/kodaymatrix.h b/korganizer/kodaymatrix.h
index 38a7f92..731117c 100644
--- a/korganizer/kodaymatrix.h
+++ b/korganizer/kodaymatrix.h
@@ -228,4 +228,5 @@ protected:
private:
+ bool mRedrawNeeded;
KODaymatrixWhatsThis* mKODaymatrixWhatsThis;
bool mouseDown;