From 5b9e0451514d65ab576b51e0f9d3515fa6b9e4e6 Mon Sep 17 00:00:00 2001 From: zautrix Date: Mon, 21 Mar 2005 09:58:16 +0000 Subject: nf --- (limited to 'korganizer/kdatenavigator.cpp') 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) -- cgit v0.9.0.2