summaryrefslogtreecommitdiffabout
path: root/korganizer/navigatorbar.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/navigatorbar.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/navigatorbar.cpp22
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
@@ -159,2 +159,21 @@ NavigatorBar::~NavigatorBar()
}
+QSize NavigatorBar::sizeHint() const
+{
+ int wid = mCurrentMinWid ;
+ if ( mPrevYear->isVisible() )
+ wid += mCurrentButtonMinWid;
+ if ( mPrevMonth->isVisible() )
+ wid += mCurrentButtonMinWid;
+ if ( mPrevWeek->isVisible() )
+ wid += mCurrentButtonMinWid;
+ if ( mNextMonth->isVisible() )
+ wid += mCurrentButtonMinWid;
+ if ( mNextWeek->isVisible() )
+ wid += mCurrentButtonMinWid;
+ if ( mNextYear->isVisible() )
+ wid += mCurrentButtonMinWid;
+ //qDebug("ret %d %d ", wid, mCurrentHei);
+ int add = 2;
+ return QSize ( wid+add, mCurrentHei+add );
+}
void NavigatorBar::resetFont ( QFont fo )
@@ -187,2 +206,5 @@ void NavigatorBar::resetFont ( QFont fo )
mNextYear->setFixedHeight ( size );
+ mCurrentHei = size;
+ mCurrentMinWid = maxwidth;
+ mCurrentButtonMinWid = mPrevYear->sizeHint().width()+2;
}