-rw-r--r-- | korganizer/navigatorbar.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/korganizer/navigatorbar.cpp b/korganizer/navigatorbar.cpp index 4a51bba..e4abbf7 100644 --- a/korganizer/navigatorbar.cpp +++ b/korganizer/navigatorbar.cpp | |||
@@ -157,6 +157,25 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam | |||
157 | NavigatorBar::~NavigatorBar() | 157 | NavigatorBar::~NavigatorBar() |
158 | { | 158 | { |
159 | } | 159 | } |
160 | QSize NavigatorBar::sizeHint() const | ||
161 | { | ||
162 | int wid = mCurrentMinWid ; | ||
163 | if ( mPrevYear->isVisible() ) | ||
164 | wid += mCurrentButtonMinWid; | ||
165 | if ( mPrevMonth->isVisible() ) | ||
166 | wid += mCurrentButtonMinWid; | ||
167 | if ( mPrevWeek->isVisible() ) | ||
168 | wid += mCurrentButtonMinWid; | ||
169 | if ( mNextMonth->isVisible() ) | ||
170 | wid += mCurrentButtonMinWid; | ||
171 | if ( mNextWeek->isVisible() ) | ||
172 | wid += mCurrentButtonMinWid; | ||
173 | if ( mNextYear->isVisible() ) | ||
174 | wid += mCurrentButtonMinWid; | ||
175 | //qDebug("ret %d %d ", wid, mCurrentHei); | ||
176 | int add = 2; | ||
177 | return QSize ( wid+add, mCurrentHei+add ); | ||
178 | } | ||
160 | void NavigatorBar::resetFont ( QFont fo ) | 179 | void NavigatorBar::resetFont ( QFont fo ) |
161 | { | 180 | { |
162 | 181 | ||
@@ -185,6 +204,9 @@ void NavigatorBar::resetFont ( QFont fo ) | |||
185 | mNextMonth->setFixedHeight( size ); | 204 | mNextMonth->setFixedHeight( size ); |
186 | mNextWeek->setFixedHeight( size ); | 205 | mNextWeek->setFixedHeight( size ); |
187 | mNextYear->setFixedHeight ( size ); | 206 | mNextYear->setFixedHeight ( size ); |
207 | mCurrentHei = size; | ||
208 | mCurrentMinWid = maxwidth; | ||
209 | mCurrentButtonMinWid = mPrevYear->sizeHint().width()+2; | ||
188 | } | 210 | } |
189 | 211 | ||
190 | void NavigatorBar::showButtons( bool left, bool right ) | 212 | void NavigatorBar::showButtons( bool left, bool right ) |