summaryrefslogtreecommitdiffabout
path: root/korganizer/koagendaview.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/koagendaview.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/koagendaview.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index 2996acb..218396d 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -76,18 +76,20 @@ extern int globalFlagBlockAgendaItemUpdate;
extern int globalFlagBlockLabel;
using namespace KOrg;
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;
enableClipper(true);
setHScrollBarMode(AlwaysOff);
setVScrollBarMode(AlwaysOff);
@@ -111,16 +113,17 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch)
// if ( globalFlagBlockAgenda )
// return;
// bug: the parameters cx, cy, cw, ch are the areas that need to be
// redrawn, not the area of the widget. unfortunately, this
// code assumes the latter...
// now, for a workaround...
// these two assignments fix the weird redraw bug
+ if ( mRedrawNeeded ) {
cx = contentsX() + 2;
cw = contentsWidth() - 2;
// end of workaround
int cell = ((int)(cy/mCellHeight));
int y = cell * mCellHeight;
QFontMetrics fm = fontMetrics();
QString hour;
@@ -178,29 +181,36 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch)
p->setFont( sFont );
offset = startW - tw2-1;
p->drawText(cx - borderWidth + offset, y+ sHei, suffix);
// increment indices
y += mCellHeight;
cell++;
}
+ } else {
+ //qDebug("NO redraw ");
+ }
+ // double buffer not yet implemented
+ //bitBlt (this, 0, 0, &myPix, 0 ,0,width(), height() ,CopyROP);
+ //mRedrawNeeded = false;
}
/**
Calculates the minimum width.
*/
int TimeLabels::minimumWidth() const
{
return mMiniWidth;
}
/** updates widget's internal state */
void TimeLabels::updateConfig()
{
+ mRedrawNeeded = true;
// set the font
// config->setGroup("Fonts");
// QFont font = config->readFontEntry("TimeBar Font");
setFont(KOPrefs::instance()->mTimeBarFont);
QString test = "88:88";
if (KGlobal::locale()->use12Clock())
test += "i";
mMiniWidth = fontMetrics().width(test) + frameWidth()*2 +1 ;