author | zautrix <zautrix> | 2005-03-21 09:40:04 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-21 09:40:04 (UTC) |
commit | fd372d97084c401aacb999e89f8bdd94056a3b59 (patch) (side-by-side diff) | |
tree | 8443519b847537711d6b423ef903ca132410a682 | |
parent | cd02f3880c5567a4bbb7b56e7034787005df7da8 (diff) | |
download | kdepimpi-fd372d97084c401aacb999e89f8bdd94056a3b59.zip kdepimpi-fd372d97084c401aacb999e89f8bdd94056a3b59.tar.gz kdepimpi-fd372d97084c401aacb999e89f8bdd94056a3b59.tar.bz2 |
layout fix
-rw-r--r-- | korganizer/navigatorbar.cpp | 22 | ||||
-rw-r--r-- | korganizer/navigatorbar.h | 4 |
2 files changed, 26 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 @@ -156,8 +156,27 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam 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 ) { QFont tfont = fo; @@ -184,8 +203,11 @@ void NavigatorBar::resetFont ( QFont fo ) mPrevWeek->setFixedHeight( size ); mNextMonth->setFixedHeight( size ); mNextWeek->setFixedHeight( size ); mNextYear->setFixedHeight ( size ); + mCurrentHei = size; + mCurrentMinWid = maxwidth; + mCurrentButtonMinWid = mPrevYear->sizeHint().width()+2; } void NavigatorBar::showButtons( bool left, bool right ) { diff --git a/korganizer/navigatorbar.h b/korganizer/navigatorbar.h index 0b2f60b..5d5aff4 100644 --- a/korganizer/navigatorbar.h +++ b/korganizer/navigatorbar.h @@ -39,8 +39,9 @@ class NavigatorBar: public QWidget NavigatorBar( const QDate & date, QWidget *parent = 0, const char *name = 0 ); ~NavigatorBar(); void showButtons( bool left, bool right ); void resetFont ( QFont fo ); + QSize sizeHint() const; public slots: void selectDates( const KCal::DateList & ); void selectMonth(); @@ -54,8 +55,11 @@ class NavigatorBar: public QWidget void goPrevYear(); void monthSelected( int ); private: + int mCurrentHei; + int mCurrentMinWid; + int mCurrentButtonMinWid; QFrame *mCtrlFrame; QPushButton *mPrevYear; QPushButton *mPrevMonth; |