summaryrefslogtreecommitdiffabout
path: root/korganizer/koagendaview.cpp
Unidiff
Diffstat (limited to 'korganizer/koagendaview.cpp') (more/less context) (show 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
@@ -126,5 +126,4 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch)
126 QString hour; 126 QString hour;
127 QString suffix; 127 QString suffix;
128 QString fullTime;
129 int tW = fm.width("24:00i"); 128 int tW = fm.width("24:00i");
130 int timeHeight = fm.height(); 129 int timeHeight = fm.height();
@@ -156,5 +155,6 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch)
156 QFontMetrics fmS( sFont ); 155 QFontMetrics fmS( sFont );
157 int sHei = fmS.height(); 156 int sHei = fmS.height();
158 157 sHei -= (sHei/4-2);
158 int startW = this->width() - frameWidth();
159 while (y < cy + ch) { 159 while (y < cy + ch) {
160 p->drawLine(cx,y,cx+tW,y); 160 p->drawLine(cx,y,cx+tW,y);
@@ -170,15 +170,12 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch)
170 } 170 }
171 171
172 // create string in format of "XX:XX" or "XXpm/am"
173 fullTime = hour;// + suffix;
174
175 // center and draw the time label 172 // center and draw the time label
176 int timeWidth = fm.width(fullTime+"i"); 173 int timeWidth = fm.width(hour+"i");
177 int tw2 = fm.width(suffix); 174 int tw2 = fm.width(suffix);
178 int offset = this->width() - timeWidth - tw2; 175 int offset = startW - timeWidth - tw2 ;
179 p->setFont( nFont ); 176 p->setFont( nFont );
180 p->drawText(cx - borderWidth + offset, y+ timeHeight, fullTime); 177 p->drawText(cx - borderWidth + offset, y+ timeHeight, hour);
181 p->setFont( sFont ); 178 p->setFont( sFont );
182 offset += timeWidth; 179 offset = startW - tw2-1;
183 p->drawText(cx - borderWidth + offset, y+ sHei, suffix); 180 p->drawText(cx - borderWidth + offset, y+ sHei, suffix);
184 181
@@ -204,5 +201,8 @@ void TimeLabels::updateConfig()
204 // QFont font = config->readFontEntry("TimeBar Font"); 201 // QFont font = config->readFontEntry("TimeBar Font");
205 setFont(KOPrefs::instance()->mTimeBarFont); 202 setFont(KOPrefs::instance()->mTimeBarFont);
206 mMiniWidth = fontMetrics().width("88:88") + 2 ; 203 QString test = "88:88";
204 if (KGlobal::locale()->use12Clock())
205 test += "i";
206 mMiniWidth = fontMetrics().width(test) + frameWidth()*2 +1 ;
207 // update geometry restrictions based on new settings 207 // update geometry restrictions based on new settings
208 setFixedWidth(minimumWidth()); 208 setFixedWidth(minimumWidth());
@@ -837,9 +837,6 @@ void KOAgendaView::createDayLabels()
837 } 837 }
838 } 838 }
839 //mDayLabelsFrame->show(); 839
840 //mDayLabels->show(); 840 mDayLabelsFrame->setFixedHeight( newHight + 4 );
841 //qDebug("heigt %d %d %d ",mDayLabelsFrame->height(), mDayLabelsFrame->sizeHint().height(), newHight);
842 //mDayLabelsFrame->resize( mAgenda->visibleWidth(), newHight );
843 mDayLabelsFrame->setFixedHeight( newHight );
844} 841}
845 842