summaryrefslogtreecommitdiffabout
path: root/korganizer
Unidiff
Diffstat (limited to 'korganizer') (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
@@ -160,7 +160,7 @@ void DateNavigatorContainer::resizeEvent( QResizeEvent * e )
160 kdDebug(5850) << " SIZEHINT: " << sizeHint() << endl; 160 kdDebug(5850) << " SIZEHINT: " << sizeHint() << endl;
161 kdDebug(5850) << " MINIMUM SIZE: " << minimumSize() << endl; 161 kdDebug(5850) << " MINIMUM SIZE: " << minimumSize() << endl;
162#endif 162#endif
163 QSize minSize = mNavigatorView->yourSizeHint(); 163 QSize minSize = mNavigatorView->sizeHintTwoButtons();
164 164
165// kdDebug(5850) << " NAVIGATORVIEW minimumSizeHint: " << minSize << endl; 165// kdDebug(5850) << " NAVIGATORVIEW minimumSizeHint: " << minSize << endl;
166 166
@@ -179,7 +179,7 @@ void DateNavigatorContainer::resizeEvent( QResizeEvent * e )
179 //mNavigatorView->resize( size() ); 179 //mNavigatorView->resize( size() );
180 //if ( ! ok ) 180 //if ( ! ok )
181 // return; 181 // return;
182 minSize = mNavigatorView->sizeHint(); 182 minSize = mNavigatorView->sizeHintTwoButtons();
183 verticalCount = size().height() / minSize.height(); 183 verticalCount = size().height() / minSize.height();
184 horizontalCount = size().width() / minSize.width(); 184 horizontalCount = size().width() / minSize.width();
185 if ( horizontalCount == 0 ) 185 if ( horizontalCount == 0 )
diff --git a/korganizer/kdatenavigator.cpp b/korganizer/kdatenavigator.cpp
index 92a0ac2..a5dbc5d 100644
--- a/korganizer/kdatenavigator.cpp
+++ b/korganizer/kdatenavigator.cpp
@@ -134,7 +134,7 @@ QFont KDateNavigator::yourFontHint( QSize si , bool *b)
134 setFont( fo ); 134 setFont( fo );
135 mFontChanged = true; 135 mFontChanged = true;
136 mNavigatorBar->resetFont( fo ); 136 mNavigatorBar->resetFont( fo );
137 QSize sh = sizeHint(); 137 QSize sh = sizeHintTwoButtons();
138 //qDebug("fp %d %d %d %d %d", fontPoint, si.width() , sh.width() , si.height() , sh.height() ); 138 //qDebug("fp %d %d %d %d %d", fontPoint, si.width() , sh.width() , si.height() , sh.height() );
139 if ( si.width() > sh.width() && si.height() > sh.height()) { 139 if ( si.width() > sh.width() && si.height() > sh.height()) {
140 *b = true; 140 *b = true;
@@ -157,6 +157,18 @@ QSize KDateNavigator::sizeHint() const
157 //qDebug("KDateNavigator+++++++++++++ %d %d", wid , hei); 157 //qDebug("KDateNavigator+++++++++++++ %d %d", wid , hei);
158 return QSize ( wid, hei ); 158 return QSize ( wid, hei );
159} 159}
160QSize KDateNavigator::sizeHintTwoButtons() const
161{
162 QFontMetrics fm ( font() );
163 QSize day = daymatrix->sizeHint();
164 QSize nav = mNavigatorBar->sizeHintTwoButtons();
165 int wid = fm.width( "30") + day.width()+3;
166 int hei = fm.height() +day.height()+nav.height()+2;
167 if ( wid < nav.width() )
168 wid = nav.width() ;
169 //qDebug("KDateNavigator+++++++++++++ %d %d", wid , hei);
170 return QSize ( wid, hei );
171}
160void KDateNavigator::slotMonthSelected( int m ) 172void KDateNavigator::slotMonthSelected( int m )
161{ 173{
162 if ( m_MthYr.month() <= mMonthSignalOffset) 174 if ( m_MthYr.month() <= mMonthSignalOffset)
diff --git a/korganizer/kdatenavigator.h b/korganizer/kdatenavigator.h
index 3177687..d1f32b6 100644
--- a/korganizer/kdatenavigator.h
+++ b/korganizer/kdatenavigator.h
@@ -70,6 +70,7 @@ class KDateNavigator: public QFrame
70 void unsetFontChanged() { mFontChanged = false; } 70 void unsetFontChanged() { mFontChanged = false; }
71 KODayMatrix *dayMatrix() { return daymatrix ;} 71 KODayMatrix *dayMatrix() { return daymatrix ;}
72 QSize sizeHint() const; 72 QSize sizeHint() const;
73 QSize sizeHintTwoButtons() const;
73 void changeFont ( QFont fo ); 74 void changeFont ( QFont fo );
74 public slots: 75 public slots:
75 void selectDates( const KCal::DateList & ); 76 void selectDates( const KCal::DateList & );
diff --git a/korganizer/navigatorbar.cpp b/korganizer/navigatorbar.cpp
index e4abbf7..1b4ee52 100644
--- a/korganizer/navigatorbar.cpp
+++ b/korganizer/navigatorbar.cpp
@@ -173,8 +173,11 @@ QSize NavigatorBar::sizeHint() const
173 if ( mNextYear->isVisible() ) 173 if ( mNextYear->isVisible() )
174 wid += mCurrentButtonMinWid; 174 wid += mCurrentButtonMinWid;
175 //qDebug("ret %d %d ", wid, mCurrentHei); 175 //qDebug("ret %d %d ", wid, mCurrentHei);
176 int add = 2; 176 return QSize ( wid, mCurrentHei );
177 return QSize ( wid+add, mCurrentHei+add ); 177}
178QSize NavigatorBar::sizeHintTwoButtons() const
179{
180 return QSize ( mCurrentMinWid + 2 * mCurrentButtonMinWid , mCurrentHei );
178} 181}
179void NavigatorBar::resetFont ( QFont fo ) 182void NavigatorBar::resetFont ( QFont fo )
180{ 183{
@@ -204,8 +207,8 @@ void NavigatorBar::resetFont ( QFont fo )
204 mNextMonth->setFixedHeight( size ); 207 mNextMonth->setFixedHeight( size );
205 mNextWeek->setFixedHeight( size ); 208 mNextWeek->setFixedHeight( size );
206 mNextYear->setFixedHeight ( size ); 209 mNextYear->setFixedHeight ( size );
207 mCurrentHei = size; 210 mCurrentHei = size +2;
208 mCurrentMinWid = maxwidth; 211 mCurrentMinWid = maxwidth+2;
209 mCurrentButtonMinWid = mPrevYear->sizeHint().width()+2; 212 mCurrentButtonMinWid = mPrevYear->sizeHint().width()+2;
210} 213}
211 214
diff --git a/korganizer/navigatorbar.h b/korganizer/navigatorbar.h
index 5d5aff4..bf6d173 100644
--- a/korganizer/navigatorbar.h
+++ b/korganizer/navigatorbar.h
@@ -41,6 +41,7 @@ class NavigatorBar: public QWidget
41 void showButtons( bool left, bool right ); 41 void showButtons( bool left, bool right );
42 void resetFont ( QFont fo ); 42 void resetFont ( QFont fo );
43 QSize sizeHint() const; 43 QSize sizeHint() const;
44 QSize sizeHintTwoButtons() const;
44 45
45 public slots: 46 public slots:
46 void selectDates( const KCal::DateList & ); 47 void selectDates( const KCal::DateList & );