Diffstat (limited to 'korganizer/kdatenavigator.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/kdatenavigator.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/korganizer/kdatenavigator.cpp b/korganizer/kdatenavigator.cpp index 5aa1c9b..6697602 100644 --- a/korganizer/kdatenavigator.cpp +++ b/korganizer/kdatenavigator.cpp | |||
@@ -132,37 +132,35 @@ QFont KDateNavigator::yourFontHint( QSize si , bool *b) | |||
132 | *b = false; | 132 | *b = false; |
133 | int fontPoint = fo.pointSize(); | 133 | int fontPoint = fo.pointSize(); |
134 | while ( fontPoint > 5 ) { | 134 | while ( fontPoint > 5 ) { |
135 | --fontPoint; | 135 | --fontPoint; |
136 | fo.setPointSize( fontPoint ); | 136 | fo.setPointSize( fontPoint ); |
137 | setFont( fo ); | 137 | setFont( fo ); |
138 | mFontChanged = true; | 138 | mFontChanged = true; |
139 | mNavigatorBar->resetFont( fo ); | 139 | mNavigatorBar->resetFont( fo ); |
140 | QSize sh = sizeHintTwoButtons( 2 ); | 140 | QSize sh = sizeHintTwoButtons( 2 ); |
141 | //qDebug("fp %d %d %d %d %d", fontPoint, si.width() , sh.width() , si.height() , sh.height() ); | 141 | //qDebug("fp %d %d %d %d %d", fontPoint, si.width() , sh.width() , si.height() , sh.height() ); |
142 | if ( si.width() > sh.width() && si.height() > sh.height()) { | 142 | if ( si.width() > sh.width() && si.height() > sh.height()) { |
143 | if ( si.width() / sh.width() == 1 ) { | 143 | if ( si.width() / sh.width() == 1 ) { |
144 | if ( si.width() < sizeHintTwoButtons( 4 ).width()) | 144 | if ( si.width() < sizeHintTwoButtons( 4 ).width()) |
145 | continue; | 145 | continue; |
146 | } | 146 | } |
147 | *b = true; | 147 | *b = true; |
148 | //qDebug("fooooooooooooooooooooooouuuuund "); | ||
149 | break; | 148 | break; |
150 | } | 149 | } |
151 | } | 150 | } |
152 | //qDebug("returnnnnnnnnnnnnnnnnnnn %d", fo.pointSize() ); | ||
153 | return fo; | 151 | return fo; |
154 | } | 152 | } |
155 | QSize KDateNavigator::sizeHint() const | 153 | QSize KDateNavigator::sizeHint() const |
156 | { | 154 | { |
157 | QFontMetrics fm ( font() ); | 155 | QFontMetrics fm ( font() ); |
158 | QSize day = daymatrix->sizeHint(); | 156 | QSize day = daymatrix->sizeHint(); |
159 | QSize nav = mNavigatorBar->sizeHint(); | 157 | QSize nav = mNavigatorBar->sizeHint(); |
160 | int wid = fm.width( "30") + day.width()+3; | 158 | int wid = fm.width( "30") + day.width()+3; |
161 | int hei = fm.height() +day.height()+nav.height()+2; | 159 | int hei = fm.height() +day.height()+nav.height()+2; |
162 | if ( wid < nav.width() ) | 160 | if ( wid < nav.width() ) |
163 | wid = nav.width() ; | 161 | wid = nav.width() ; |
164 | //qDebug("KDateNavigator+++++++++++++ %d %d", wid , hei); | 162 | //qDebug("KDateNavigator+++++++++++++ %d %d", wid , hei); |
165 | return QSize ( wid, hei ); | 163 | return QSize ( wid, hei ); |
166 | } | 164 | } |
167 | QSize KDateNavigator::sizeHintTwoButtons( int butnum ) const | 165 | QSize KDateNavigator::sizeHintTwoButtons( int butnum ) const |
168 | { | 166 | { |
@@ -355,33 +353,33 @@ void KDateNavigator::updateConfig() | |||
355 | day = i+1; | 353 | day = i+1; |
356 | } else { | 354 | } else { |
357 | if (i==0) day = 7; | 355 | if (i==0) day = 7; |
358 | else day = i; | 356 | else day = i; |
359 | } | 357 | } |
360 | QString dayName = KOGlobals::self()->calendarSystem()->weekDayName( day, | 358 | QString dayName = KOGlobals::self()->calendarSystem()->weekDayName( day, |
361 | true ); | 359 | true ); |
362 | if ( KOPrefs::instance()->mCompactDialogs ) dayName = dayName.left( 1 ); | 360 | if ( KOPrefs::instance()->mCompactDialogs ) dayName = dayName.left( 1 ); |
363 | headings[i]->setText( dayName ); | 361 | headings[i]->setText( dayName ); |
364 | } | 362 | } |
365 | updateDates(); | 363 | updateDates(); |
366 | updateView(); | 364 | updateView(); |
367 | } | 365 | } |
368 | 366 | ||
369 | void KDateNavigator::setShowWeekNums(bool enabled) | 367 | void KDateNavigator::setShowWeekNums(bool enabled) |
370 | { | 368 | { |
371 | qDebug("KDateNavigator::setShowWeekNums***************************** "); | 369 | |
372 | m_bShowWeekNums = enabled; | 370 | m_bShowWeekNums = enabled; |
373 | for(int i=0; i<6; i++) { | 371 | for(int i=0; i<6; i++) { |
374 | if(enabled) | 372 | if(enabled) |
375 | weeknos[i]->show(); | 373 | weeknos[i]->show(); |
376 | else | 374 | else |
377 | weeknos[i]->hide(); | 375 | weeknos[i]->hide(); |
378 | } | 376 | } |
379 | resize(size()); | 377 | resize(size()); |
380 | } | 378 | } |
381 | 379 | ||
382 | void KDateNavigator::selectDates(const DateList& dateList) | 380 | void KDateNavigator::selectDates(const DateList& dateList) |
383 | { | 381 | { |
384 | 382 | ||
385 | if (dateList.count() > 0) { | 383 | if (dateList.count() > 0) { |
386 | mNavigatorBar->selectDates( dateList ); | 384 | mNavigatorBar->selectDates( dateList ); |
387 | mSelectedDates = dateList; | 385 | mSelectedDates = dateList; |