summaryrefslogtreecommitdiffabout
path: root/korganizer/koagendaview.cpp
authorzautrix <zautrix>2005-04-01 18:10:09 (UTC)
committer zautrix <zautrix>2005-04-01 18:10:09 (UTC)
commitedc032c21ae3788d02a632ea8066e4ac5a4feedb (patch) (side-by-side diff)
tree8e59c8dcf1cc3021694025627d36e152f7adc389 /korganizer/koagendaview.cpp
parent5d88f92b76a760f100384ea5fa6ed143088d19bb (diff)
downloadkdepimpi-edc032c21ae3788d02a632ea8066e4ac5a4feedb.zip
kdepimpi-edc032c21ae3788d02a632ea8066e4ac5a4feedb.tar.gz
kdepimpi-edc032c21ae3788d02a632ea8066e4ac5a4feedb.tar.bz2
fixes
Diffstat (limited to 'korganizer/koagendaview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagendaview.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index 218396d..072d464 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -118,9 +118,10 @@ 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
+ mRedrawNeeded = true;
if ( mRedrawNeeded ) {
- cx = contentsX() + 2;
- cw = contentsWidth() - 2;
+ cx = contentsX() + frameWidth()*2;
+ cw = contentsWidth() ;
// end of workaround
int cell = ((int)(cy/mCellHeight));
@@ -152,13 +153,13 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch)
borderWidth = 4;
timeHeight = fm.height();
}
- timeHeight -= (timeHeight/4-2);
+ //timeHeight -= (timeHeight/4-2);
QFont sFont = nFont;
sFont.setPointSize( sFont.pointSize()/2+2 );
QFontMetrics fmS( sFont );
int sHei = fmS.height();
- sHei -= (sHei/4-2);
- int startW = this->width() - frameWidth();
+ //sHei -= (sHei/4-2);
+ int startW = this->width() - frameWidth()-1;
while (y < cy + ch) {
p->drawLine(cx,y,cx+tW,y);
hour.setNum(cell);
@@ -173,14 +174,14 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch)
}
// center and draw the time label
- int timeWidth = fm.width(hour+"i");
+ int timeWidth = fm.width(hour);
int tw2 = fm.width(suffix);
int offset = startW - timeWidth - tw2 ;
p->setFont( nFont );
- p->drawText(cx - borderWidth + offset, y+ timeHeight, hour);
+ p->drawText( offset, y+ timeHeight, hour);
p->setFont( sFont );
- offset = startW - tw2-1;
- p->drawText(cx - borderWidth + offset, y+ sHei, suffix);
+ offset = startW - tw2+1;
+ p->drawText( offset, y+ sHei, suffix);
// increment indices
y += mCellHeight;
@@ -418,8 +419,7 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) :
int heibut = mExpandButton->sizeHint().height()+4;
if ( heibut > widebut )
widebut = heibut ;
- if ( QApplication::desktop()->width() < 480 )
- widebut = widebut*3/2;
+
//mExpandButton->setSizePolicy( QSizePolicy( QSizePolicy::Fixed,
// QSizePolicy::Fixed ) );
mExpandButton->setFixedSize( widebut, widebut);
@@ -717,7 +717,7 @@ void KOAgendaView::createDayLabels()
appendLabels = true;
dayLabel = getNewDaylabel();
}
- dayLabel->setFixedWidth( mTimeLabels->width()+2 );
+ dayLabel->setFixedWidth( mTimeLabels->width()+mAgenda->frameWidth() );
dayLabel->setFont( dlf );
dayLabel->setNum( -1 );
//dayLabel->setAlignment(QLabel::AlignHCenter);
@@ -828,8 +828,8 @@ void KOAgendaView::createDayLabels()
dayLabel = getNewDaylabel();
}
//dayLabel->hide();//test only
-
- int offset = (mAgenda->width() - mAgenda->verticalScrollBar()->width()-3 ) % mSelectedDates.count() ;
+ qDebug("fremwidd %d ", mAgenda->frameWidth());
+ int offset = (mAgenda->width() - mAgenda->verticalScrollBar()->width()- (mAgenda->frameWidth()*2) ) % mSelectedDates.count() ;
if ( offset < 0 ) offset = 0;
//qDebug("mLayoutDayLabels->addSpacing %d ", mAgenda->verticalScrollBar()->width()+offset+2 );
dayLabel->setText(">");//QString::number ( mSelectedDates.first().month() ) );