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.cpp27
1 files changed, 12 insertions, 15 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index 18f242c..f6f390b 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -127,3 +127,2 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch)
QString suffix;
- QString fullTime;
int tW = fm.width("24:00i");
@@ -157,3 +156,4 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch)
int sHei = fmS.height();
-
+ sHei -= (sHei/4-2);
+ int startW = this->width() - frameWidth();
while (y < cy + ch) {
@@ -171,13 +171,10 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch)
- // create string in format of "XX:XX" or "XXpm/am"
- fullTime = hour;// + suffix;
-
// center and draw the time label
- int timeWidth = fm.width(fullTime+"i");
+ int timeWidth = fm.width(hour+"i");
int tw2 = fm.width(suffix);
- int offset = this->width() - timeWidth - tw2;
+ int offset = startW - timeWidth - tw2 ;
p->setFont( nFont );
- p->drawText(cx - borderWidth + offset, y+ timeHeight, fullTime);
+ p->drawText(cx - borderWidth + offset, y+ timeHeight, hour);
p->setFont( sFont );
- offset += timeWidth;
+ offset = startW - tw2-1;
p->drawText(cx - borderWidth + offset, y+ sHei, suffix);
@@ -205,3 +202,6 @@ void TimeLabels::updateConfig()
setFont(KOPrefs::instance()->mTimeBarFont);
- mMiniWidth = fontMetrics().width("88:88") + 2 ;
+ QString test = "88:88";
+ if (KGlobal::locale()->use12Clock())
+ test += "i";
+ mMiniWidth = fontMetrics().width(test) + frameWidth()*2 +1 ;
// update geometry restrictions based on new settings
@@ -838,7 +838,4 @@ void KOAgendaView::createDayLabels()
}
- //mDayLabelsFrame->show();
- //mDayLabels->show();
- //qDebug("heigt %d %d %d ",mDayLabelsFrame->height(), mDayLabelsFrame->sizeHint().height(), newHight);
- //mDayLabelsFrame->resize( mAgenda->visibleWidth(), newHight );
- mDayLabelsFrame->setFixedHeight( newHight );
+
+ mDayLabelsFrame->setFixedHeight( newHight + 4 );
}