-rw-r--r-- | korganizer/kdatenavigator.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/korganizer/kdatenavigator.cpp b/korganizer/kdatenavigator.cpp index 92a0ac2..a5dbc5d 100644 --- a/korganizer/kdatenavigator.cpp +++ b/korganizer/kdatenavigator.cpp @@ -134,7 +134,7 @@ QFont KDateNavigator::yourFontHint( QSize si , bool *b) setFont( fo ); mFontChanged = true; mNavigatorBar->resetFont( fo ); - QSize sh = sizeHint(); + QSize sh = sizeHintTwoButtons(); //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()) { *b = true; @@ -157,6 +157,18 @@ QSize KDateNavigator::sizeHint() const //qDebug("KDateNavigator+++++++++++++ %d %d", wid , hei); return QSize ( wid, hei ); } +QSize KDateNavigator::sizeHintTwoButtons() const +{ + QFontMetrics fm ( font() ); + QSize day = daymatrix->sizeHint(); + QSize nav = mNavigatorBar->sizeHintTwoButtons(); + int wid = fm.width( "30") + day.width()+3; + int hei = fm.height() +day.height()+nav.height()+2; + if ( wid < nav.width() ) + wid = nav.width() ; + //qDebug("KDateNavigator+++++++++++++ %d %d", wid , hei); + return QSize ( wid, hei ); +} void KDateNavigator::slotMonthSelected( int m ) { if ( m_MthYr.month() <= mMonthSignalOffset) |