summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-03-21 09:40:04 (UTC)
committer zautrix <zautrix>2005-03-21 09:40:04 (UTC)
commitfd372d97084c401aacb999e89f8bdd94056a3b59 (patch) (side-by-side diff)
tree8443519b847537711d6b423ef903ca132410a682 /korganizer
parentcd02f3880c5567a4bbb7b56e7034787005df7da8 (diff)
downloadkdepimpi-fd372d97084c401aacb999e89f8bdd94056a3b59.zip
kdepimpi-fd372d97084c401aacb999e89f8bdd94056a3b59.tar.gz
kdepimpi-fd372d97084c401aacb999e89f8bdd94056a3b59.tar.bz2
layout fix
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/navigatorbar.cpp22
-rw-r--r--korganizer/navigatorbar.h4
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
@@ -154,12 +154,31 @@ 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;
if ( QApplication::desktop()->width() >= 480 )
tfont.setPointSize(tfont.pointSize()+2);
@@ -182,12 +201,15 @@ void NavigatorBar::resetFont ( QFont fo )
mPrevYear->setFixedHeight( size );
mPrevMonth->setFixedHeight( size );
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 )
{
if ( left ) {
mPrevYear->show();
diff --git a/korganizer/navigatorbar.h b/korganizer/navigatorbar.h
index 0b2f60b..5d5aff4 100644
--- a/korganizer/navigatorbar.h
+++ b/korganizer/navigatorbar.h
@@ -37,12 +37,13 @@ class NavigatorBar: public QWidget
Q_OBJECT
public:
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();
signals:
@@ -52,12 +53,15 @@ class NavigatorBar: public QWidget
void goPrevWeek();
void goNextYear();
void goPrevYear();
void monthSelected( int );
private:
+ int mCurrentHei;
+ int mCurrentMinWid;
+ int mCurrentButtonMinWid;
QFrame *mCtrlFrame;
QPushButton *mPrevYear;
QPushButton *mPrevMonth;
QPushButton *mNextMonth;
QPushButton *mPrevWeek;