summaryrefslogtreecommitdiffabout
path: root/korganizer/koagendaview.cpp
authorzautrix <zautrix>2005-03-25 19:42:13 (UTC)
committer zautrix <zautrix>2005-03-25 19:42:13 (UTC)
commitae440bf75e7f74f35f83d082de9c7a34d2d3c65d (patch) (side-by-side diff)
treec1aa1e79a58463081e207479ee0ccad5c9f8e9cf /korganizer/koagendaview.cpp
parent89a72c007045dcfa5dbf57012b4cf0c2aebd1495 (diff)
downloadkdepimpi-ae440bf75e7f74f35f83d082de9c7a34d2d3c65d.zip
kdepimpi-ae440bf75e7f74f35f83d082de9c7a34d2d3c65d.tar.gz
kdepimpi-ae440bf75e7f74f35f83d082de9c7a34d2d3c65d.tar.bz2
layout fixes
Diffstat (limited to 'korganizer/koagendaview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagendaview.cpp32
1 files changed, 21 insertions, 11 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index 5508210..f287216 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -129,2 +129,13 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch)
int tW = fm.width("24:00i");
+ int timeHeight = fm.height();
+ if ( timeHeight > mCellHeight )
+ timeHeight = mCellHeight-1;
+ int borderWidth = 5;
+ QFont nFont = p->font();
+ QFont sFont = nFont;
+ sFont.setPointSize( sFont.pointSize()/2+2 );
+ if (!KGlobal::locale()->use12Clock())
+ suffix = "00";
+ QFontMetrics fmS( sFont );
+ int sHei = fmS.height();
@@ -133,3 +144,2 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch)
hour.setNum(cell);
- suffix = "am";
@@ -138,6 +148,6 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch)
if (cell > 11) suffix = "pm";
+ else
+ suffix = "am";
if (cell == 0) hour.setNum(12);
if (cell > 12) hour.setNum(cell - 12);
- } else {
- suffix = ":00";
}
@@ -145,3 +155,3 @@ 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;
+ fullTime = hour;// + suffix;
@@ -149,7 +159,9 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch)
int timeWidth = fm.width(fullTime+"i");
- int offset = this->width() - timeWidth;
- int borderWidth = 5;
- int timeHeight = fm.height();
- timeHeight = timeHeight + 2 - ( timeHeight / 4 );
- p->drawText(cx -borderWidth + offset, y+ timeHeight, fullTime);
+ int tw2 = fm.width(suffix);
+ int offset = this->width() - timeWidth - tw2;
+ p->setFont( nFont );
+ p->drawText(cx - borderWidth + offset, y+ timeHeight, fullTime);
+ p->setFont( sFont );
+ offset += timeWidth;
+ p->drawText(cx - borderWidth + offset, y+ sHei, suffix);
@@ -882,4 +894,2 @@ void KOAgendaView::updateConfig()
-
-
// update config for children