summaryrefslogtreecommitdiffabout
path: root/korganizer/kdatenavigator.cpp
Unidiff
Diffstat (limited to 'korganizer/kdatenavigator.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kdatenavigator.cpp11
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
@@ -116,6 +116,7 @@ KDateNavigator::KDateNavigator( QWidget *parent, const char *name )
116 updateConfig(); 116 updateConfig();
117 enableRollover(FollowMonth); 117 enableRollover(FollowMonth);
118 mySizeHint = sizeHintTwoButtons(); 118 mySizeHint = sizeHintTwoButtons();
119 myFullSizeHint = sizeHintTwoButtons( 4 );
119 mFontChanged = false; 120 mFontChanged = false;
120} 121}
121void KDateNavigator::changeFont ( QFont fo ) 122void KDateNavigator::changeFont ( QFont fo )
@@ -134,9 +135,13 @@ QFont KDateNavigator::yourFontHint( QSize si , bool *b)
134 setFont( fo ); 135 setFont( fo );
135 mFontChanged = true; 136 mFontChanged = true;
136 mNavigatorBar->resetFont( fo ); 137 mNavigatorBar->resetFont( fo );
137 QSize sh = sizeHintTwoButtons(); 138 QSize sh = sizeHintTwoButtons( 2 );
138 //qDebug("fp %d %d %d %d %d", fontPoint, si.width() , sh.width() , si.height() , sh.height() ); 139 //qDebug("fp %d %d %d %d %d", fontPoint, si.width() , sh.width() , si.height() , sh.height() );
139 if ( si.width() > sh.width() && si.height() > sh.height()) { 140 if ( si.width() > sh.width() && si.height() > sh.height()) {
141 if ( si.width() / sh.width() == 1 ) {
142 if ( si.width() < sizeHintTwoButtons( 4 ).width())
143 continue;
144 }
140 *b = true; 145 *b = true;
141 //qDebug("fooooooooooooooooooooooouuuuund "); 146 //qDebug("fooooooooooooooooooooooouuuuund ");
142 break; 147 break;
@@ -157,11 +162,11 @@ QSize KDateNavigator::sizeHint() const
157 //qDebug("KDateNavigator+++++++++++++ %d %d", wid , hei); 162 //qDebug("KDateNavigator+++++++++++++ %d %d", wid , hei);
158 return QSize ( wid, hei ); 163 return QSize ( wid, hei );
159} 164}
160QSize KDateNavigator::sizeHintTwoButtons() const 165QSize KDateNavigator::sizeHintTwoButtons( int butnum ) const
161{ 166{
162 QFontMetrics fm ( font() ); 167 QFontMetrics fm ( font() );
163 QSize day = daymatrix->sizeHint(); 168 QSize day = daymatrix->sizeHint();
164 QSize nav = mNavigatorBar->sizeHintTwoButtons(); 169 QSize nav = mNavigatorBar->sizeHintTwoButtons( butnum );
165 int wid = fm.width( "30") + day.width()+3; 170 int wid = fm.width( "30") + day.width()+3;
166 int hei = fm.height() +day.height()+nav.height()+2; 171 int hei = fm.height() +day.height()+nav.height()+2;
167 if ( wid < nav.width() ) 172 if ( wid < nav.width() )