author | zautrix <zautrix> | 2005-03-27 10:47:39 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-27 10:47:39 (UTC) |
commit | 1800cf5f3af1f666dddcbfffe3171adcd467ae3d (patch) (unidiff) | |
tree | 64b69e4bfbeacf5a036f027dd099c82c6c77e299 /korganizer | |
parent | b170a7414ff72016285ea207caa7ccf786530e77 (diff) | |
download | kdepimpi-1800cf5f3af1f666dddcbfffe3171adcd467ae3d.zip kdepimpi-1800cf5f3af1f666dddcbfffe3171adcd467ae3d.tar.gz kdepimpi-1800cf5f3af1f666dddcbfffe3171adcd467ae3d.tar.bz2 |
fixxx
-rw-r--r-- | korganizer/koagendaview.cpp | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index fa6b951..18f242c 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp | |||
@@ -127,23 +127,35 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch) | |||
127 | QString suffix; | 127 | QString suffix; |
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 = 0; | 132 | int borderWidth = 0; |
133 | QFont nFont = p->font(); | 133 | QFont nFont = p->font(); |
134 | QFont sFont = nFont; | 134 | |
135 | sFont.setPointSize( sFont.pointSize()/2+2 ); | ||
136 | if (!KGlobal::locale()->use12Clock()) | 135 | if (!KGlobal::locale()->use12Clock()) |
137 | suffix = "00"; | 136 | suffix = "00"; |
138 | else | 137 | else |
139 | borderWidth = 0; | 138 | borderWidth = 0; |
140 | QFontMetrics fmS( sFont ); | ||
141 | int sHei = fmS.height(); | ||
142 | if ( timeHeight > mCellHeight ) { | 139 | if ( timeHeight > mCellHeight ) { |
143 | timeHeight = mCellHeight-1; | 140 | timeHeight = mCellHeight-1; |
144 | sHei -= 2; | 141 | int pointS = nFont.pointSize(); |
142 | while ( pointS > 4 ) { | ||
143 | nFont.setPointSize( pointS ); | ||
144 | fm = QFontMetrics( nFont ); | ||
145 | if ( fm.height() < mCellHeight ) | ||
146 | break; | ||
147 | -- pointS; | ||
148 | } | ||
149 | fm = QFontMetrics( nFont ); | ||
150 | borderWidth = 4; | ||
151 | timeHeight = fm.height(); | ||
145 | } | 152 | } |
153 | timeHeight -= (timeHeight/4-2); | ||
154 | QFont sFont = nFont; | ||
155 | sFont.setPointSize( sFont.pointSize()/2+2 ); | ||
156 | QFontMetrics fmS( sFont ); | ||
157 | int sHei = fmS.height(); | ||
146 | 158 | ||
147 | while (y < cy + ch) { | 159 | while (y < cy + ch) { |
148 | p->drawLine(cx,y,cx+tW,y); | 160 | p->drawLine(cx,y,cx+tW,y); |
149 | hour.setNum(cell); | 161 | hour.setNum(cell); |
@@ -888,8 +900,14 @@ void KOAgendaView::updateView() | |||
888 | void KOAgendaView::updateConfig() | 900 | void KOAgendaView::updateConfig() |
889 | { | 901 | { |
890 | if ( mBlockUpdating ) | 902 | if ( mBlockUpdating ) |
891 | return; | 903 | return; |
904 | if ( mAgenda->height() > 96 * KOPrefs::instance()->mHourSize ) { | ||
905 | int old = KOPrefs::instance()->mHourSize; | ||
906 | KOPrefs::instance()->mHourSize = mAgenda->height()/96 +1; | ||
907 | qDebug("KOPrefs::instance()->mHourSize adjusted %d to %d ", old,KOPrefs::instance()->mHourSize ); | ||
908 | } | ||
909 | |||
892 | 910 | ||
893 | // update config for children | 911 | // update config for children |
894 | mTimeLabels->updateConfig(); | 912 | mTimeLabels->updateConfig(); |
895 | mAgenda->storePosition(); | 913 | mAgenda->storePosition(); |