author | zautrix <zautrix> | 2005-03-21 09:58:16 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-21 09:58:16 (UTC) |
commit | 5b9e0451514d65ab576b51e0f9d3515fa6b9e4e6 (patch) (unidiff) | |
tree | c3e1f114768876675b6ab6463083d03dff321b4e | |
parent | fd372d97084c401aacb999e89f8bdd94056a3b59 (diff) | |
download | kdepimpi-5b9e0451514d65ab576b51e0f9d3515fa6b9e4e6.zip kdepimpi-5b9e0451514d65ab576b51e0f9d3515fa6b9e4e6.tar.gz kdepimpi-5b9e0451514d65ab576b51e0f9d3515fa6b9e4e6.tar.bz2 |
nf
-rw-r--r-- | korganizer/datenavigatorcontainer.cpp | 4 | ||||
-rw-r--r-- | korganizer/kdatenavigator.cpp | 14 | ||||
-rw-r--r-- | korganizer/kdatenavigator.h | 1 | ||||
-rw-r--r-- | korganizer/navigatorbar.cpp | 11 | ||||
-rw-r--r-- | korganizer/navigatorbar.h | 1 |
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 | } |
160 | QSize 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 | } | ||
160 | void KDateNavigator::slotMonthSelected( int m ) | 172 | void 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 | } |
178 | QSize NavigatorBar::sizeHintTwoButtons() const | ||
179 | { | ||
180 | return QSize ( mCurrentMinWid + 2 * mCurrentButtonMinWid , mCurrentHei ); | ||
178 | } | 181 | } |
179 | void NavigatorBar::resetFont ( QFont fo ) | 182 | void 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 & ); |