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.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index b9c7dec..8001c8f 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -114,48 +114,50 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch)
// 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
cx = contentsX() + 2;
cw = contentsWidth() - 2;
// end of workaround
int cell = ((int)(cy/mCellHeight));
int y = cell * mCellHeight;
QFontMetrics fm = fontMetrics();
QString hour;
QString suffix;
QString fullTime;
int tW = fm.width("24:00i");
int timeHeight = fm.height();
timeHeight -= (timeHeight/4-2);
int borderWidth = 2;
QFont nFont = p->font();
QFont sFont = nFont;
sFont.setPointSize( sFont.pointSize()/2+2 );
if (!KGlobal::locale()->use12Clock())
suffix = "00";
+ else
+ borderWidth = 0;
QFontMetrics fmS( sFont );
int sHei = fmS.height();
if ( timeHeight > mCellHeight ) {
timeHeight = mCellHeight-1;
sHei -= 2;
}
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()) {
if (cell > 11) suffix = "pm";
else
suffix = "am";
if (cell == 0) hour.setNum(12);
if (cell > 12) hour.setNum(cell - 12);
}
// create string in format of "XX:XX" or "XXpm/am"
fullTime = hour;// + suffix;
// center and draw the time label