-rw-r--r-- | korganizer/koagendaview.cpp | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index 957ac52..b9c7dec 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp | |||
@@ -128,9 +128,9 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch) | |||
128 | QString fullTime; | 128 | QString fullTime; |
129 | int tW = fm.width("24:00i"); | 129 | int tW = fm.width("24:00i"); |
130 | int timeHeight = fm.height(); | 130 | int timeHeight = fm.height(); |
131 | timeHeight -= (timeHeight/4-2); | 131 | timeHeight -= (timeHeight/4-2); |
132 | int borderWidth = 5; | 132 | int borderWidth = 2; |
133 | QFont nFont = p->font(); | 133 | QFont nFont = p->font(); |
134 | QFont sFont = nFont; | 134 | QFont sFont = nFont; |
135 | sFont.setPointSize( sFont.pointSize()/2+2 ); | 135 | sFont.setPointSize( sFont.pointSize()/2+2 ); |
136 | if (!KGlobal::locale()->use12Clock()) | 136 | if (!KGlobal::locale()->use12Clock()) |
@@ -178,17 +178,9 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch) | |||
178 | Calculates the minimum width. | 178 | Calculates the minimum width. |
179 | */ | 179 | */ |
180 | int TimeLabels::minimumWidth() const | 180 | int TimeLabels::minimumWidth() const |
181 | { | 181 | { |
182 | QFontMetrics fm = fontMetrics(); | 182 | return mMiniWidth; |
183 | |||
184 | //TODO: calculate this value | ||
185 | int borderWidth = 4; | ||
186 | |||
187 | // the maximum width possible | ||
188 | int width = fm.width("88:88x") + borderWidth; | ||
189 | |||
190 | return width; | ||
191 | } | 183 | } |
192 | 184 | ||
193 | /** updates widget's internal state */ | 185 | /** updates widget's internal state */ |
194 | void TimeLabels::updateConfig() | 186 | void TimeLabels::updateConfig() |
@@ -196,9 +188,9 @@ void TimeLabels::updateConfig() | |||
196 | // set the font | 188 | // set the font |
197 | // config->setGroup("Fonts"); | 189 | // config->setGroup("Fonts"); |
198 | // QFont font = config->readFontEntry("TimeBar Font"); | 190 | // QFont font = config->readFontEntry("TimeBar Font"); |
199 | setFont(KOPrefs::instance()->mTimeBarFont); | 191 | setFont(KOPrefs::instance()->mTimeBarFont); |
200 | 192 | mMiniWidth = fontMetrics().width("88:88") + 2 ; | |
201 | // update geometry restrictions based on new settings | 193 | // update geometry restrictions based on new settings |
202 | setFixedWidth(minimumWidth()); | 194 | setFixedWidth(minimumWidth()); |
203 | 195 | ||
204 | // update HourSize | 196 | // update HourSize |