author | zautrix <zautrix> | 2005-03-25 19:42:13 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-25 19:42:13 (UTC) |
commit | ae440bf75e7f74f35f83d082de9c7a34d2d3c65d (patch) (unidiff) | |
tree | c1aa1e79a58463081e207479ee0ccad5c9f8e9cf /korganizer/koagendaview.cpp | |
parent | 89a72c007045dcfa5dbf57012b4cf0c2aebd1495 (diff) | |
download | kdepimpi-ae440bf75e7f74f35f83d082de9c7a34d2d3c65d.zip kdepimpi-ae440bf75e7f74f35f83d082de9c7a34d2d3c65d.tar.gz kdepimpi-ae440bf75e7f74f35f83d082de9c7a34d2d3c65d.tar.bz2 |
layout fixes
-rw-r--r-- | korganizer/koagendaview.cpp | 32 |
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) | |||
129 | int tW = fm.width("24:00i"); | 129 | int tW = fm.width("24:00i"); |
130 | int timeHeight = fm.height(); | ||
131 | if ( timeHeight > mCellHeight ) | ||
132 | timeHeight = mCellHeight-1; | ||
133 | int borderWidth = 5; | ||
134 | QFont nFont = p->font(); | ||
135 | QFont sFont = nFont; | ||
136 | sFont.setPointSize( sFont.pointSize()/2+2 ); | ||
137 | if (!KGlobal::locale()->use12Clock()) | ||
138 | suffix = "00"; | ||
139 | QFontMetrics fmS( sFont ); | ||
140 | int sHei = fmS.height(); | ||
130 | 141 | ||
@@ -133,3 +144,2 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch) | |||
133 | hour.setNum(cell); | 144 | hour.setNum(cell); |
134 | suffix = "am"; | ||
135 | 145 | ||
@@ -138,6 +148,6 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch) | |||
138 | if (cell > 11) suffix = "pm"; | 148 | if (cell > 11) suffix = "pm"; |
149 | else | ||
150 | suffix = "am"; | ||
139 | if (cell == 0) hour.setNum(12); | 151 | if (cell == 0) hour.setNum(12); |
140 | if (cell > 12) hour.setNum(cell - 12); | 152 | if (cell > 12) hour.setNum(cell - 12); |
141 | } else { | ||
142 | suffix = ":00"; | ||
143 | } | 153 | } |
@@ -145,3 +155,3 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch) | |||
145 | // create string in format of "XX:XX" or "XXpm/am" | 155 | // create string in format of "XX:XX" or "XXpm/am" |
146 | fullTime = hour + suffix; | 156 | fullTime = hour;// + suffix; |
147 | 157 | ||
@@ -149,7 +159,9 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch) | |||
149 | int timeWidth = fm.width(fullTime+"i"); | 159 | int timeWidth = fm.width(fullTime+"i"); |
150 | int offset = this->width() - timeWidth; | 160 | int tw2 = fm.width(suffix); |
151 | int borderWidth = 5; | 161 | int offset = this->width() - timeWidth - tw2; |
152 | int timeHeight = fm.height(); | 162 | p->setFont( nFont ); |
153 | timeHeight = timeHeight + 2 - ( timeHeight / 4 ); | 163 | p->drawText(cx - borderWidth + offset, y+ timeHeight, fullTime); |
154 | p->drawText(cx -borderWidth + offset, y+ timeHeight, fullTime); | 164 | p->setFont( sFont ); |
165 | offset += timeWidth; | ||
166 | p->drawText(cx - borderWidth + offset, y+ sHei, suffix); | ||
155 | 167 | ||
@@ -882,4 +894,2 @@ void KOAgendaView::updateConfig() | |||
882 | 894 | ||
883 | |||
884 | |||
885 | // update config for children | 895 | // update config for children |