summaryrefslogtreecommitdiffabout
path: root/korganizer/koagendaview.cpp
Side-by-side diff
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
@@ -115,15 +115,16 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch)
// 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
+ mRedrawNeeded = true;
if ( mRedrawNeeded ) {
- cx = contentsX() + 2;
- cw = contentsWidth() - 2;
+ cx = contentsX() + frameWidth()*2;
+ cw = contentsWidth() ;
// end of workaround
int cell = ((int)(cy/mCellHeight));
int y = cell * mCellHeight;
QFontMetrics fm = fontMetrics();
QString hour;
@@ -149,19 +150,19 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch)
-- pointS;
}
fm = QFontMetrics( nFont );
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);
// handle 24h and am/pm time formats
if (KGlobal::locale()->use12Clock()) {
@@ -170,20 +171,20 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch)
suffix = "am";
if (cell == 0) hour.setNum(12);
if (cell > 12) hour.setNum(cell - 12);
}
// 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;
cell++;
}
} else {
@@ -415,14 +416,13 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) :
mExpandButton = new QPushButton(mDummyAllDayLeft);
mExpandButton->setPixmap( expandPix );
int widebut = mExpandButton->sizeHint().width()+4;
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);
connect( mExpandButton, SIGNAL( clicked() ), SIGNAL( toggleExpand() ) );
mExpandButton->setFocusPolicy(NoFocus);
mAllDayAgenda = new KOAgenda(1,mAllDayFrame);
@@ -714,13 +714,13 @@ void KOAgendaView::createDayLabels()
KOAgendaButton *dayLabel;
dayLabel = mDayLabelsList.first();
if ( !dayLabel ) {
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);
dayLabel->setText( KOGlobals::self()->calendarSystem()->monthName( mSelectedDates.first(), true ) );
dayLabel->show();
DateList::ConstIterator dit;
@@ -825,14 +825,14 @@ void KOAgendaView::createDayLabels()
appendLabels = true;
}
if ( appendLabels ) {
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() ) );
dayLabel->setFont( dlf );
dayLabel->setAutoRepeat( true );
dayLabel->show();