-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 | |||
@@ -130,7 +130,6 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch) | |||
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()) |
@@ -139,8 +138,21 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch) | |||
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 | ||
@@ -891,2 +903,8 @@ void KOAgendaView::updateConfig() | |||
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 | ||