-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 | |||
@@ -133,9 +133,9 @@ QFont KDateNavigator::yourFontHint( QSize si , bool *b) | |||
133 | fo.setPointSize( fontPoint ); | 133 | fo.setPointSize( fontPoint ); |
134 | setFont( fo ); | 134 | setFont( fo ); |
135 | mFontChanged = true; | 135 | mFontChanged = true; |
136 | mNavigatorBar->resetFont( fo ); | 136 | mNavigatorBar->resetFont( fo ); |
137 | QSize sh = sizeHint(); | 137 | QSize sh = sizeHintTwoButtons(); |
138 | //qDebug("fp %d %d %d %d %d", fontPoint, si.width() , sh.width() , si.height() , sh.height() ); | 138 | //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()) { | 139 | if ( si.width() > sh.width() && si.height() > sh.height()) { |
140 | *b = true; | 140 | *b = true; |
141 | //qDebug("fooooooooooooooooooooooouuuuund "); | 141 | //qDebug("fooooooooooooooooooooooouuuuund "); |
@@ -156,8 +156,20 @@ QSize KDateNavigator::sizeHint() const | |||
156 | wid = nav.width() ; | 156 | wid = nav.width() ; |
157 | //qDebug("KDateNavigator+++++++++++++ %d %d", wid , hei); | 157 | //qDebug("KDateNavigator+++++++++++++ %d %d", wid , hei); |
158 | return QSize ( wid, hei ); | 158 | return QSize ( wid, hei ); |
159 | } | 159 | } |
160 | QSize KDateNavigator::sizeHintTwoButtons() const | ||
161 | { | ||
162 | QFontMetrics fm ( font() ); | ||
163 | QSize day = daymatrix->sizeHint(); | ||
164 | QSize nav = mNavigatorBar->sizeHintTwoButtons(); | ||
165 | int wid = fm.width( "30") + day.width()+3; | ||
166 | int hei = fm.height() +day.height()+nav.height()+2; | ||
167 | if ( wid < nav.width() ) | ||
168 | wid = nav.width() ; | ||
169 | //qDebug("KDateNavigator+++++++++++++ %d %d", wid , hei); | ||
170 | return QSize ( wid, hei ); | ||
171 | } | ||
160 | void KDateNavigator::slotMonthSelected( int m ) | 172 | void KDateNavigator::slotMonthSelected( int m ) |
161 | { | 173 | { |
162 | if ( m_MthYr.month() <= mMonthSignalOffset) | 174 | if ( m_MthYr.month() <= mMonthSignalOffset) |
163 | m += 12; | 175 | m += 12; |