author | zautrix <zautrix> | 2005-03-30 13:24:56 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-30 13:24:56 (UTC) |
commit | 056f171723a9301aea5a65340dffeda34e078abf (patch) (unidiff) | |
tree | 7930525c801dd9c5d9a910b71bca7dc79e10f666 /korganizer/datenavigatorcontainer.cpp | |
parent | b5222dd7a607f78235b1ea39fea0f95a9c08ccd3 (diff) | |
download | kdepimpi-056f171723a9301aea5a65340dffeda34e078abf.zip kdepimpi-056f171723a9301aea5a65340dffeda34e078abf.tar.gz kdepimpi-056f171723a9301aea5a65340dffeda34e078abf.tar.bz2 |
fixes
Diffstat (limited to 'korganizer/datenavigatorcontainer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/datenavigatorcontainer.cpp | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/korganizer/datenavigatorcontainer.cpp b/korganizer/datenavigatorcontainer.cpp index 27ba9e0..f6f62a4 100644 --- a/korganizer/datenavigatorcontainer.cpp +++ b/korganizer/datenavigatorcontainer.cpp | |||
@@ -184,82 +184,80 @@ void DateNavigatorContainer::checkUpdateDayMatrixDates() | |||
184 | QFont fo; | 184 | QFont fo; |
185 | if ( horizontalCount != mHorizontalCount || | 185 | if ( horizontalCount != mHorizontalCount || |
186 | verticalCount != mVerticalCount ) { | 186 | verticalCount != mVerticalCount ) { |
187 | uint count = horizontalCount * verticalCount; | 187 | uint count = horizontalCount * verticalCount; |
188 | if ( count == 0 ) { | 188 | if ( count == 0 ) { |
189 | bool ok; | 189 | bool ok; |
190 | fo = mNavigatorView->yourFontHint( size() , &ok ); | 190 | fo = mNavigatorView->yourFontHint( size() , &ok ); |
191 | //mNavigatorView->resize( size() ); | 191 | //mNavigatorView->resize( size() ); |
192 | //if ( ! ok ) | 192 | //if ( ! ok ) |
193 | // return; | 193 | // return; |
194 | int butt = 2; | 194 | int butt = 2; |
195 | horizontalCount = size().width() / mNavigatorView->sizeHintTwoButtons( ).width(); | 195 | horizontalCount = size().width() / mNavigatorView->sizeHintTwoButtons( ).width(); |
196 | if ( horizontalCount <= 1 ) | 196 | if ( horizontalCount <= 1 ) |
197 | minSize = mNavigatorView->sizeHintTwoButtons( 4 ); | 197 | minSize = mNavigatorView->sizeHintTwoButtons( 4 ); |
198 | else | 198 | else |
199 | minSize = mNavigatorView->sizeHintTwoButtons(); | 199 | minSize = mNavigatorView->sizeHintTwoButtons(); |
200 | verticalCount = size().height() / minSize.height(); | 200 | verticalCount = size().height() / minSize.height(); |
201 | horizontalCount = size().width() / minSize.width(); | 201 | horizontalCount = size().width() / minSize.width(); |
202 | if ( horizontalCount == 0 ) | 202 | if ( horizontalCount == 0 ) |
203 | horizontalCount = 1; | 203 | horizontalCount = 1; |
204 | if ( verticalCount == 0 ) | 204 | if ( verticalCount == 0 ) |
205 | verticalCount = 1; | 205 | verticalCount = 1; |
206 | fontchange = true; | 206 | fontchange = true; |
207 | count = horizontalCount * verticalCount; | 207 | count = horizontalCount * verticalCount; |
208 | } else { | 208 | } |
209 | if ( mNavigatorView->fontChanged() ) { | 209 | |
210 | fontchange = true; | ||
211 | fo = KOPrefs::instance()->mDateNavigatorFont; | ||
212 | mNavigatorView->changeFont( fo ); | ||
213 | mNavigatorView->unsetFontChanged(); | ||
214 | } | ||
215 | } | ||
216 | |||
217 | mLastDisplayedDN = horizontalCount*verticalCount-1; | 210 | mLastDisplayedDN = horizontalCount*verticalCount-1; |
218 | while ( count > ( mExtraViews.count() + 1 ) ) { | 211 | while ( count > ( mExtraViews.count() + 1 ) ) { |
219 | KDateNavigator *n = new KDateNavigator( this ); | 212 | KDateNavigator *n = new KDateNavigator( this ); |
220 | n->setMonthSignalOffset ( mExtraViews.count()+1 ); | 213 | n->setMonthSignalOffset ( mExtraViews.count()+1 ); |
221 | mExtraViews.append( n ); | 214 | mExtraViews.append( n ); |
222 | n->setCalendar( mCalendar ); | 215 | n->setCalendar( mCalendar ); |
223 | connectNavigatorView( n ); | 216 | connectNavigatorView( n ); |
224 | // n->show(); | 217 | // n->show(); |
225 | } | 218 | } |
226 | 219 | ||
227 | |||
228 | setBaseDates(); | 220 | setBaseDates(); |
229 | if ( fontchange ) { | ||
230 | //mNavigatorView->changeFont( fo ); | ||
231 | uint i; | ||
232 | for( i = 0; i < mExtraViews.count(); ++i ) { | ||
233 | KDateNavigator *view = mExtraViews.at( i ); | ||
234 | view->changeFont( fo ); | ||
235 | } | ||
236 | } | ||
237 | mHorizontalCount = horizontalCount; | 221 | mHorizontalCount = horizontalCount; |
238 | mVerticalCount = verticalCount; | 222 | mVerticalCount = verticalCount; |
239 | 223 | ||
240 | } | 224 | } |
241 | 225 | if ( !fontchange ) { | |
226 | if ( mNavigatorView->fontChanged() ) { | ||
227 | fontchange = true; | ||
228 | fo = KOPrefs::instance()->mDateNavigatorFont; | ||
229 | mNavigatorView->changeFont( fo ); | ||
230 | mNavigatorView->unsetFontChanged(); | ||
231 | } | ||
232 | } | ||
233 | if ( fontchange ) { | ||
234 | uint i; | ||
235 | for( i = 0; i < mLastDisplayedDN; ++i ) { | ||
236 | KDateNavigator *view = mExtraViews.at( i ); | ||
237 | view->changeFont( fo ); | ||
238 | } | ||
239 | } | ||
242 | int theight = height() / mVerticalCount; | 240 | int theight = height() / mVerticalCount; |
243 | int twidth = width() / mHorizontalCount; | 241 | int twidth = width() / mHorizontalCount; |
244 | 242 | ||
245 | NavigatorBar *bar = mNavigatorView->navigatorBar(); | 243 | NavigatorBar *bar = mNavigatorView->navigatorBar(); |
246 | if ( mHorizontalCount > 1 ) bar->showButtons( true, false ); | 244 | if ( mHorizontalCount > 1 ) bar->showButtons( true, false ); |
247 | else bar->showButtons( true, true ); | 245 | else bar->showButtons( true, true ); |
248 | 246 | ||
249 | mNavigatorView->setGeometry(0, | 247 | mNavigatorView->setGeometry(0, |
250 | 0, twidth, theight ); | 248 | 0, twidth, theight ); |
251 | for( uint i = 0; i < mLastDisplayedDN; ++i ) { | 249 | for( uint i = 0; i < mLastDisplayedDN; ++i ) { |
252 | int x = ( i + 1 ) % mHorizontalCount; | 250 | int x = ( i + 1 ) % mHorizontalCount; |
253 | int y = ( i + 1 ) / mHorizontalCount; | 251 | int y = ( i + 1 ) / mHorizontalCount; |
254 | 252 | ||
255 | KDateNavigator *view = mExtraViews.at( i ); | 253 | KDateNavigator *view = mExtraViews.at( i ); |
256 | bar = view->navigatorBar(); | 254 | bar = view->navigatorBar(); |
257 | if ( y > 0 ) bar->showButtons( false, false ); | 255 | if ( y > 0 ) bar->showButtons( false, false ); |
258 | else { | 256 | else { |
259 | if ( x + 1 == mHorizontalCount ) bar->showButtons( false, true ); | 257 | if ( x + 1 == mHorizontalCount ) bar->showButtons( false, true ); |
260 | else bar->showButtons( false, false ); | 258 | else bar->showButtons( false, false ); |
261 | } | 259 | } |
262 | view->setGeometry( x * twidth, | 260 | view->setGeometry( x * twidth, |
263 | y * theight, twidth, theight ); | 261 | y * theight, twidth, theight ); |
264 | } | 262 | } |
265 | int iii = 0; | 263 | int iii = 0; |