summaryrefslogtreecommitdiffabout
Unidiff
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
@@ -157,13 +157,13 @@ void DateNavigatorContainer::resizeEvent( QResizeEvent * e )
157 kdDebug(5850) << "DateNavigatorContainer::resizeEvent()" << endl; 157 kdDebug(5850) << "DateNavigatorContainer::resizeEvent()" << endl;
158 kdDebug(5850) << " CURRENT SIZE: " << size() << endl; 158 kdDebug(5850) << " CURRENT SIZE: " << size() << endl;
159 kdDebug(5850) << " MINIMUM SIZEHINT: " << minimumSizeHint() << endl; 159 kdDebug(5850) << " MINIMUM SIZEHINT: " << minimumSizeHint() << endl;
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
167 int verticalCount = size().height() / minSize.height(); 167 int verticalCount = size().height() / minSize.height();
168 int horizontalCount = size().width() / minSize.width(); 168 int horizontalCount = size().width() / minSize.width();
169 //qDebug(" wattdatt %d new %d %d ", size().width() ,e->size().width() , minSize.width() ); 169 //qDebug(" wattdatt %d new %d %d ", size().width() ,e->size().width() , minSize.width() );
@@ -176,13 +176,13 @@ void DateNavigatorContainer::resizeEvent( QResizeEvent * e )
176 if ( count == 0 ) { 176 if ( count == 0 ) {
177 bool ok; 177 bool ok;
178 fo = mNavigatorView->yourFontHint( size() , &ok); 178 fo = mNavigatorView->yourFontHint( size() , &ok);
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 )
186 horizontalCount = 1; 186 horizontalCount = 1;
187 if ( verticalCount == 0 ) 187 if ( verticalCount == 0 )
188 verticalCount = 1; 188 verticalCount = 1;
diff --git a/korganizer/kdatenavigator.cpp b/korganizer/kdatenavigator.cpp
index 92a0ac2..a5dbc5d 100644
--- a/korganizer/kdatenavigator.cpp
+++ b/korganizer/kdatenavigator.cpp
@@ -131,13 +131,13 @@ QFont KDateNavigator::yourFontHint( QSize si , bool *b)
131 while ( fontPoint > 5 ) { 131 while ( fontPoint > 5 ) {
132 --fontPoint; 132 --fontPoint;
133 fo.setPointSize( fontPoint ); 133 fo.setPointSize( fontPoint );
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;
141 //qDebug("fooooooooooooooooooooooouuuuund "); 141 //qDebug("fooooooooooooooooooooooouuuuund ");
142 break; 142 break;
143 } 143 }
@@ -154,12 +154,24 @@ QSize KDateNavigator::sizeHint() const
154 int hei = fm.height() +day.height()+nav.height()+2; 154 int hei = fm.height() +day.height()+nav.height()+2;
155 if ( wid < nav.width() ) 155 if ( wid < nav.width() )
156 wid = nav.width() ; 156 wid = nav.width() ;
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)
163 m += 12; 175 m += 12;
164 int mo = m - mMonthSignalOffset; 176 int mo = m - mMonthSignalOffset;
165 emit monthSelected( m - mMonthSignalOffset ); 177 emit monthSelected( m - mMonthSignalOffset );
diff --git a/korganizer/kdatenavigator.h b/korganizer/kdatenavigator.h
index 3177687..d1f32b6 100644
--- a/korganizer/kdatenavigator.h
+++ b/korganizer/kdatenavigator.h
@@ -67,12 +67,13 @@ class KDateNavigator: public QFrame
67 QSize yourSizeHint() { return mySizeHint; } 67 QSize yourSizeHint() { return mySizeHint; }
68 QFont yourFontHint( QSize , bool * b); 68 QFont yourFontHint( QSize , bool * b);
69 bool fontChanged() {return mFontChanged; } 69 bool fontChanged() {return mFontChanged; }
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 & );
76 void updateView(); 77 void updateView();
77 void updateConfig(); 78 void updateConfig();
78 void updateDayMatrix(); 79 void updateDayMatrix();
diff --git a/korganizer/navigatorbar.cpp b/korganizer/navigatorbar.cpp
index e4abbf7..1b4ee52 100644
--- a/korganizer/navigatorbar.cpp
+++ b/korganizer/navigatorbar.cpp
@@ -170,14 +170,17 @@ QSize NavigatorBar::sizeHint() const
170 wid += mCurrentButtonMinWid; 170 wid += mCurrentButtonMinWid;
171 if ( mNextWeek->isVisible() ) 171 if ( mNextWeek->isVisible() )
172 wid += mCurrentButtonMinWid; 172 wid += mCurrentButtonMinWid;
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{
181 184
182 QFont tfont = fo; 185 QFont tfont = fo;
183 if ( QApplication::desktop()->width() >= 480 ) 186 if ( QApplication::desktop()->width() >= 480 )
@@ -201,14 +204,14 @@ void NavigatorBar::resetFont ( QFont fo )
201 mPrevYear->setFixedHeight( size ); 204 mPrevYear->setFixedHeight( size );
202 mPrevMonth->setFixedHeight( size ); 205 mPrevMonth->setFixedHeight( size );
203 mPrevWeek->setFixedHeight( size ); 206 mPrevWeek->setFixedHeight( size );
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
212void NavigatorBar::showButtons( bool left, bool right ) 215void NavigatorBar::showButtons( bool left, bool right )
213{ 216{
214 if ( left ) { 217 if ( left ) {
diff --git a/korganizer/navigatorbar.h b/korganizer/navigatorbar.h
index 5d5aff4..bf6d173 100644
--- a/korganizer/navigatorbar.h
+++ b/korganizer/navigatorbar.h
@@ -38,12 +38,13 @@ class NavigatorBar: public QWidget
38 public: 38 public:
39 NavigatorBar( const QDate & date, QWidget *parent = 0, const char *name = 0 ); 39 NavigatorBar( const QDate & date, QWidget *parent = 0, const char *name = 0 );
40 ~NavigatorBar(); 40 ~NavigatorBar();
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 & );
47 void selectMonth(); 48 void selectMonth();
48 49
49 signals: 50 signals: