summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/datenavigatorcontainer.cpp4
-rw-r--r--korganizer/kdatenavigator.cpp14
-rw-r--r--korganizer/kdatenavigator.h1
-rw-r--r--korganizer/navigatorbar.cpp11
-rw-r--r--korganizer/navigatorbar.h1
5 files changed, 24 insertions, 7 deletions
diff --git a/korganizer/datenavigatorcontainer.cpp b/korganizer/datenavigatorcontainer.cpp
index 3358ecf..5cdaa83 100644
--- a/korganizer/datenavigatorcontainer.cpp
+++ b/korganizer/datenavigatorcontainer.cpp
@@ -162,3 +162,3 @@ void DateNavigatorContainer::resizeEvent( QResizeEvent * e )
#endif
- QSize minSize = mNavigatorView->yourSizeHint();
+ QSize minSize = mNavigatorView->sizeHintTwoButtons();
@@ -181,3 +181,3 @@ void DateNavigatorContainer::resizeEvent( QResizeEvent * e )
// return;
- minSize = mNavigatorView->sizeHint();
+ minSize = mNavigatorView->sizeHintTwoButtons();
verticalCount = size().height() / minSize.height();
diff --git a/korganizer/kdatenavigator.cpp b/korganizer/kdatenavigator.cpp
index 92a0ac2..a5dbc5d 100644
--- a/korganizer/kdatenavigator.cpp
+++ b/korganizer/kdatenavigator.cpp
@@ -136,3 +136,3 @@ QFont KDateNavigator::yourFontHint( QSize si , bool *b)
mNavigatorBar->resetFont( fo );
- QSize sh = sizeHint();
+ QSize sh = sizeHintTwoButtons();
//qDebug("fp %d %d %d %d %d", fontPoint, si.width() , sh.width() , si.height() , sh.height() );
@@ -159,2 +159,14 @@ QSize KDateNavigator::sizeHint() const
}
+QSize KDateNavigator::sizeHintTwoButtons() const
+{
+ QFontMetrics fm ( font() );
+ QSize day = daymatrix->sizeHint();
+ QSize nav = mNavigatorBar->sizeHintTwoButtons();
+ int wid = fm.width( "30") + day.width()+3;
+ int hei = fm.height() +day.height()+nav.height()+2;
+ if ( wid < nav.width() )
+ wid = nav.width() ;
+ //qDebug("KDateNavigator+++++++++++++ %d %d", wid , hei);
+ return QSize ( wid, hei );
+}
void KDateNavigator::slotMonthSelected( int m )
diff --git a/korganizer/kdatenavigator.h b/korganizer/kdatenavigator.h
index 3177687..d1f32b6 100644
--- a/korganizer/kdatenavigator.h
+++ b/korganizer/kdatenavigator.h
@@ -72,2 +72,3 @@ class KDateNavigator: public QFrame
QSize sizeHint() const;
+ QSize sizeHintTwoButtons() const;
void changeFont ( QFont fo );
diff --git a/korganizer/navigatorbar.cpp b/korganizer/navigatorbar.cpp
index e4abbf7..1b4ee52 100644
--- a/korganizer/navigatorbar.cpp
+++ b/korganizer/navigatorbar.cpp
@@ -175,4 +175,7 @@ QSize NavigatorBar::sizeHint() const
//qDebug("ret %d %d ", wid, mCurrentHei);
- int add = 2;
- return QSize ( wid+add, mCurrentHei+add );
+ return QSize ( wid, mCurrentHei );
+}
+QSize NavigatorBar::sizeHintTwoButtons() const
+{
+ return QSize ( mCurrentMinWid + 2 * mCurrentButtonMinWid , mCurrentHei );
}
@@ -206,4 +209,4 @@ void NavigatorBar::resetFont ( QFont fo )
mNextYear->setFixedHeight ( size );
- mCurrentHei = size;
- mCurrentMinWid = maxwidth;
+ mCurrentHei = size +2;
+ mCurrentMinWid = maxwidth+2;
mCurrentButtonMinWid = mPrevYear->sizeHint().width()+2;
diff --git a/korganizer/navigatorbar.h b/korganizer/navigatorbar.h
index 5d5aff4..bf6d173 100644
--- a/korganizer/navigatorbar.h
+++ b/korganizer/navigatorbar.h
@@ -43,2 +43,3 @@ class NavigatorBar: public QWidget
QSize sizeHint() const;
+ QSize sizeHintTwoButtons() const;