summaryrefslogtreecommitdiffabout
Unidiff
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
@@ -80,10 +80,12 @@ using namespace KOrg;
80 80
81TimeLabels::TimeLabels(int rows,QWidget *parent,const char *name,WFlags f) : 81TimeLabels::TimeLabels(int rows,QWidget *parent,const char *name,WFlags f) :
82 QScrollView(parent,name,f) 82 QScrollView(parent,name,f)
83{ 83{
84 myPix.resize( 1, 1 );
84 mRows = rows; 85 mRows = rows;
85 86
87 mRedrawNeeded = true;
86 setMinimumHeight( 20 ); 88 setMinimumHeight( 20 );
87 mCellHeight = KOPrefs::instance()->mHourSize*4; 89 mCellHeight = KOPrefs::instance()->mHourSize*4;
88 90
89 enableClipper(true); 91 enableClipper(true);
@@ -115,8 +117,9 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch)
115 // code assumes the latter... 117 // code assumes the latter...
116 118
117 // now, for a workaround... 119 // now, for a workaround...
118 // these two assignments fix the weird redraw bug 120 // these two assignments fix the weird redraw bug
121 if ( mRedrawNeeded ) {
119 cx = contentsX() + 2; 122 cx = contentsX() + 2;
120 cw = contentsWidth() - 2; 123 cw = contentsWidth() - 2;
121 // end of workaround 124 // end of workaround
122 125
@@ -182,8 +185,14 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch)
182 // increment indices 185 // increment indices
183 y += mCellHeight; 186 y += mCellHeight;
184 cell++; 187 cell++;
185 } 188 }
189 } else {
190 //qDebug("NO redraw ");
191 }
192 // double buffer not yet implemented
193 //bitBlt (this, 0, 0, &myPix, 0 ,0,width(), height() ,CopyROP);
194 //mRedrawNeeded = false;
186} 195}
187 196
188/** 197/**
189 Calculates the minimum width. 198 Calculates the minimum width.
@@ -195,8 +204,9 @@ int TimeLabels::minimumWidth() const
195 204
196/** updates widget's internal state */ 205/** updates widget's internal state */
197void TimeLabels::updateConfig() 206void TimeLabels::updateConfig()
198{ 207{
208 mRedrawNeeded = true;
199 // set the font 209 // set the font
200 // config->setGroup("Fonts"); 210 // config->setGroup("Fonts");
201 // QFont font = config->readFontEntry("TimeBar Font"); 211 // QFont font = config->readFontEntry("TimeBar Font");
202 setFont(KOPrefs::instance()->mTimeBarFont); 212 setFont(KOPrefs::instance()->mTimeBarFont);
diff --git a/korganizer/koagendaview.h b/korganizer/koagendaview.h
index 6dc81c6..30c9b05 100644
--- a/korganizer/koagendaview.h
+++ b/korganizer/koagendaview.h
@@ -100,8 +100,10 @@ class TimeLabels : public QScrollView {
100 protected: 100 protected:
101 void drawContents(QPainter *p,int cx, int cy, int cw, int ch); 101 void drawContents(QPainter *p,int cx, int cy, int cw, int ch);
102 102
103 private: 103 private:
104 QPixmap myPix;
105 bool mRedrawNeeded;
104 int mMiniWidth; 106 int mMiniWidth;
105 int mMouseDownY; 107 int mMouseDownY;
106 QString mOrgCap; 108 QString mOrgCap;
107 int mRows; 109 int mRows;
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 )
109KODayMatrix::KODayMatrix(QWidget *parent, Calendar* calendar, QDate date, const char *name) : 109KODayMatrix::KODayMatrix(QWidget *parent, Calendar* calendar, QDate date, const char *name) :
110 QFrame(parent, name) 110 QFrame(parent, name)
111#endif 111#endif
112{ 112{
113 mRedrawNeeded = true;
113 mKODaymatrixWhatsThis = new KODaymatrixWhatsThis(this); 114 mKODaymatrixWhatsThis = new KODaymatrixWhatsThis(this);
114 mPendingUpdateBeforeRepaint = false; 115 mPendingUpdateBeforeRepaint = false;
115 mouseDown = false; 116 mouseDown = false;
116 // initialize dynamic arrays 117 // initialize dynamic arrays
@@ -385,8 +386,9 @@ void KODayMatrix::updateViewTimed()
385 } else { 386 } else {
386 mHolidays[i] = QString::null; 387 mHolidays[i] = QString::null;
387 } 388 }
388 } 389 }
390 mRedrawNeeded = true;
389 if ( ! mPendingUpdateBeforeRepaint ) 391 if ( ! mPendingUpdateBeforeRepaint )
390 repaint(false); 392 repaint(false);
391} 393}
392void KODayMatrix::updateView(QDate actdate) 394void KODayMatrix::updateView(QDate actdate)
@@ -419,17 +421,18 @@ void KODayMatrix::updateView(QDate actdate)
419 } 421 }
420 startdate = actdate; 422 startdate = actdate;
421 mDayChanged = true; 423 mDayChanged = true;
422 recalculateToday(); 424 recalculateToday();
425 mRedrawNeeded = true;
423 } 426 }
424 //qDebug("restart Timer %d vis: %d", mDayChanged, isVisible() ); 427 //qDebug("restart Timer %d vis: %d", mDayChanged, isVisible() );
425 if ( !isVisible() ) { 428 if ( !isVisible() ) {
426 mPendingUpdateBeforeRepaint = true; 429 mPendingUpdateBeforeRepaint = true;
427 } else { 430 } else {
428#ifdef DESKTOP_VERSION 431#ifdef DESKTOP_VERSION
429 //mRepaintTimer->start( 100 ); 432 //mRepaintTimer->start( 100 );
430 //updateViewTimed(); 433 //updateViewTimed();
431 mUpdateTimer->start( 20 ); 434 mUpdateTimer->start( 50 );
432#else 435#else
433 mRepaintTimer->start( 350 ); 436 mRepaintTimer->start( 350 );
434 mUpdateTimer->start( 1200 ); 437 mUpdateTimer->start( 1200 );
435#endif 438#endif
@@ -677,9 +680,13 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
677 mPendingUpdateBeforeRepaint = false; 680 mPendingUpdateBeforeRepaint = false;
678 } 681 }
679 if ( myPix.width() != width() || myPix.height()!=height() ) { 682 if ( myPix.width() != width() || myPix.height()!=height() ) {
680 myPix.resize(size() ); 683 myPix.resize(size() );
684 mRedrawNeeded = true;
681 } 685 }
686
687 if ( mRedrawNeeded ) {
688 //qDebug("REDRAW ");
682 QPainter p(&myPix); 689 QPainter p(&myPix);
683 p.setFont(font()); 690 p.setFont(font());
684 691
685 692
@@ -926,11 +933,13 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
926 myFont.setBold(false); 933 myFont.setBold(false);
927 p.setFont(myFont); 934 p.setFont(myFont);
928 } 935 }
929 } 936 }
930 int off = 0;//xyOff; 937 } else {
931 bitBlt (this, off, off, &myPix, 0 ,0,width(), height() ,CopyROP); 938 //qDebug("NO redraw ");
932 //qDebug("ffffffffff %d ", off); 939 }
940 bitBlt (this, 0, 0, &myPix, 0 ,0,width(), height() ,CopyROP);
941 mRedrawNeeded = false;
933} 942}
934 943
935// ---------------------------------------------------------------------------- 944// ----------------------------------------------------------------------------
936// R E SI Z E E V E N T H A N D L I N G 945// R E SI Z E E V E N T H A N D L I N G
diff --git a/korganizer/kodaymatrix.h b/korganizer/kodaymatrix.h
index 38a7f92..731117c 100644
--- a/korganizer/kodaymatrix.h
+++ b/korganizer/kodaymatrix.h
@@ -226,8 +226,9 @@ protected:
226 226
227 void resizeEvent(QResizeEvent *); 227 void resizeEvent(QResizeEvent *);
228 228
229private: 229private:
230 bool mRedrawNeeded;
230 KODaymatrixWhatsThis* mKODaymatrixWhatsThis; 231 KODaymatrixWhatsThis* mKODaymatrixWhatsThis;
231 bool mouseDown; 232 bool mouseDown;
232 QBitArray bDays; 233 QBitArray bDays;
233 QBitArray hDays; 234 QBitArray hDays;