Diffstat (limited to 'korganizer/kdatenavigator.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/kdatenavigator.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/korganizer/kdatenavigator.cpp b/korganizer/kdatenavigator.cpp index fe83e09..231095f 100644 --- a/korganizer/kdatenavigator.cpp +++ b/korganizer/kdatenavigator.cpp @@ -115,8 +115,9 @@ KDateNavigator::KDateNavigator( QWidget *parent, const char *name ) // read settings from configuration file. updateConfig(); enableRollover(FollowMonth); mySizeHint = sizeHintTwoButtons(); + myFullSizeHint = sizeHintTwoButtons( 4 ); mFontChanged = false; } void KDateNavigator::changeFont ( QFont fo ) { @@ -133,11 +134,15 @@ QFont KDateNavigator::yourFontHint( QSize si , bool *b) fo.setPointSize( fontPoint ); setFont( fo ); mFontChanged = true; mNavigatorBar->resetFont( fo ); - QSize sh = sizeHintTwoButtons(); + QSize sh = sizeHintTwoButtons( 2 ); //qDebug("fp %d %d %d %d %d", fontPoint, si.width() , sh.width() , si.height() , sh.height() ); if ( si.width() > sh.width() && si.height() > sh.height()) { + if ( si.width() / sh.width() == 1 ) { + if ( si.width() < sizeHintTwoButtons( 4 ).width()) + continue; + } *b = true; //qDebug("fooooooooooooooooooooooouuuuund "); break; } @@ -156,13 +161,13 @@ QSize KDateNavigator::sizeHint() const wid = nav.width() ; //qDebug("KDateNavigator+++++++++++++ %d %d", wid , hei); return QSize ( wid, hei ); } -QSize KDateNavigator::sizeHintTwoButtons() const +QSize KDateNavigator::sizeHintTwoButtons( int butnum ) const { QFontMetrics fm ( font() ); QSize day = daymatrix->sizeHint(); - QSize nav = mNavigatorBar->sizeHintTwoButtons(); + QSize nav = mNavigatorBar->sizeHintTwoButtons( butnum ); int wid = fm.width( "30") + day.width()+3; int hei = fm.height() +day.height()+nav.height()+2; if ( wid < nav.width() ) wid = nav.width() ; |