author | zautrix <zautrix> | 2005-03-22 09:31:41 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-22 09:31:41 (UTC) |
commit | d18536f758f4cf64d5c59d7a7c814e6ff12f9a3d (patch) (side-by-side diff) | |
tree | 326186e1a65db5a9ba174fa2bdbd3dffc7f23b9f /korganizer/kdatenavigator.cpp | |
parent | 8888389a4511e0bda23774b993dcfdeb7f837c31 (diff) | |
download | kdepimpi-d18536f758f4cf64d5c59d7a7c814e6ff12f9a3d.zip kdepimpi-d18536f758f4cf64d5c59d7a7c814e6ff12f9a3d.tar.gz kdepimpi-d18536f758f4cf64d5c59d7a7c814e6ff12f9a3d.tar.bz2 |
layout fixes
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 @@ -113,12 +113,13 @@ KDateNavigator::KDateNavigator( QWidget *parent, const char *name ) topLayout->addMultiCellWidget(daymatrix,2,7,1,7); // read settings from configuration file. updateConfig(); enableRollover(FollowMonth); mySizeHint = sizeHintTwoButtons(); + myFullSizeHint = sizeHintTwoButtons( 4 ); mFontChanged = false; } void KDateNavigator::changeFont ( QFont fo ) { setFont( fo ); mNavigatorBar->resetFont( fo ); @@ -131,15 +132,19 @@ QFont KDateNavigator::yourFontHint( QSize si , bool *b) while ( fontPoint > 5 ) { --fontPoint; 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; } } //qDebug("returnnnnnnnnnnnnnnnnnnn %d", fo.pointSize() ); @@ -154,17 +159,17 @@ QSize KDateNavigator::sizeHint() const 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 ); } -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() ; //qDebug("KDateNavigator+++++++++++++ %d %d", wid , hei); return QSize ( wid, hei ); |