author | zautrix <zautrix> | 2005-03-19 22:56:08 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-19 22:56:08 (UTC) |
commit | 84c18843bbd1203878367572d3a6800a0586c7f1 (patch) (unidiff) | |
tree | 9f58b7356ea700d47e6ec84fb4a462a666a24049 /korganizer | |
parent | 39b719bdc75d95913c3aaf9a03aaa57b1161cc61 (diff) | |
download | kdepimpi-84c18843bbd1203878367572d3a6800a0586c7f1.zip kdepimpi-84c18843bbd1203878367572d3a6800a0586c7f1.tar.gz kdepimpi-84c18843bbd1203878367572d3a6800a0586c7f1.tar.bz2 |
mochn fix
-rw-r--r-- | korganizer/calendarview.cpp | 1 | ||||
-rw-r--r-- | korganizer/datenavigatorcontainer.cpp | 20 | ||||
-rw-r--r-- | korganizer/kdatenavigator.cpp | 7 | ||||
-rw-r--r-- | korganizer/kdatenavigator.h | 5 | ||||
-rw-r--r-- | korganizer/kodaymatrix.cpp | 2 |
5 files changed, 24 insertions, 11 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 29c530b..9acbbb1 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -1856,7 +1856,6 @@ void CalendarView::readSettings() | |||
1856 | sizes << 100; | 1856 | sizes << 100; |
1857 | } | 1857 | } |
1858 | mLeftFrame->setSizes(sizes); | 1858 | mLeftFrame->setSizes(sizes); |
1859 | qDebug("sizes count %d ", sizes.count()); | ||
1860 | if ( dateCount == 5 ) mNavigator->selectWorkWeek(); | 1859 | if ( dateCount == 5 ) mNavigator->selectWorkWeek(); |
1861 | else if ( dateCount == 7 ) mNavigator->selectWeek(); | 1860 | else if ( dateCount == 7 ) mNavigator->selectWeek(); |
1862 | else mNavigator->selectDates( dateCount ); | 1861 | else mNavigator->selectDates( dateCount ); |
diff --git a/korganizer/datenavigatorcontainer.cpp b/korganizer/datenavigatorcontainer.cpp index 3f6e29b..d09f484 100644 --- a/korganizer/datenavigatorcontainer.cpp +++ b/korganizer/datenavigatorcontainer.cpp | |||
@@ -127,6 +127,11 @@ void DateNavigatorContainer::selectDates( const DateList &dateList ) | |||
127 | { | 127 | { |
128 | mNavigatorView->selectDates( dateList ); | 128 | mNavigatorView->selectDates( dateList ); |
129 | setBaseDates(); | 129 | setBaseDates(); |
130 | if ( mExtraViews.count() ) { | ||
131 | KDateNavigator *view = mExtraViews.at( 0 ); | ||
132 | view->dayMatrix()->setSelectedDaysFrom(*(dateList.begin()), *(--dateList.end())); | ||
133 | view->dayMatrix()->repaint(); | ||
134 | } | ||
130 | } | 135 | } |
131 | 136 | ||
132 | void DateNavigatorContainer::setBaseDates() | 137 | void DateNavigatorContainer::setBaseDates() |
@@ -137,13 +142,15 @@ void DateNavigatorContainer::setBaseDates() | |||
137 | } | 142 | } |
138 | QDate baseDate = dateList.first(); | 143 | QDate baseDate = dateList.first(); |
139 | KDateNavigator *n; | 144 | KDateNavigator *n; |
145 | bool doRepaint = false; // skip first repaint | ||
140 | for( n = mExtraViews.first(); n; n = mExtraViews.next() ) { | 146 | for( n = mExtraViews.first(); n; n = mExtraViews.next() ) { |
141 | baseDate = baseDate.addDays( baseDate.daysInMonth () ); | 147 | baseDate = baseDate.addDays( baseDate.daysInMonth () ); |
142 | n->setBaseDate( baseDate ); | 148 | n->setBaseDate( baseDate, doRepaint ); |
149 | doRepaint = true; | ||
143 | } | 150 | } |
144 | } | 151 | } |
145 | 152 | ||
146 | void DateNavigatorContainer::resizeEvent( QResizeEvent * ) | 153 | void DateNavigatorContainer::resizeEvent( QResizeEvent * e ) |
147 | { | 154 | { |
148 | #if 0 | 155 | #if 0 |
149 | kdDebug(5850) << "DateNavigatorContainer::resizeEvent()" << endl; | 156 | kdDebug(5850) << "DateNavigatorContainer::resizeEvent()" << endl; |
@@ -152,18 +159,21 @@ void DateNavigatorContainer::resizeEvent( QResizeEvent * ) | |||
152 | kdDebug(5850) << " SIZEHINT: " << sizeHint() << endl; | 159 | kdDebug(5850) << " SIZEHINT: " << sizeHint() << endl; |
153 | kdDebug(5850) << " MINIMUM SIZE: " << minimumSize() << endl; | 160 | kdDebug(5850) << " MINIMUM SIZE: " << minimumSize() << endl; |
154 | #endif | 161 | #endif |
155 | 162 | QSize minSize = mNavigatorView->yourSizeHint(); | |
156 | QSize minSize = mNavigatorView->minimumSizeHint(); | ||
157 | 163 | ||
158 | // kdDebug(5850) << " NAVIGATORVIEW minimumSizeHint: " << minSize << endl; | 164 | // kdDebug(5850) << " NAVIGATORVIEW minimumSizeHint: " << minSize << endl; |
159 | 165 | ||
160 | int verticalCount = size().height() / minSize.height(); | 166 | int verticalCount = size().height() / minSize.height(); |
161 | int horizontalCount = size().width() / minSize.width(); | 167 | int horizontalCount = size().width() / minSize.width(); |
168 | //qDebug(" wattdatt %d new %d %d ", size().width() ,e->size().width() , minSize.width() ); | ||
162 | //qDebug("COUNT %d %d %d %d ", verticalCount, horizontalCount , mVerticalCount, mHorizontalCount ); | 169 | //qDebug("COUNT %d %d %d %d ", verticalCount, horizontalCount , mVerticalCount, mHorizontalCount ); |
163 | if ( horizontalCount != mHorizontalCount || | 170 | if ( horizontalCount != mHorizontalCount || |
164 | verticalCount != mVerticalCount ) { | 171 | verticalCount != mVerticalCount ) { |
165 | uint count = horizontalCount * verticalCount; | 172 | uint count = horizontalCount * verticalCount; |
166 | if ( count == 0 ) return; | 173 | if ( count == 0 ) { |
174 | mNavigatorView->resize( minSize ); | ||
175 | return; | ||
176 | } | ||
167 | 177 | ||
168 | while ( count > ( mExtraViews.count() + 1 ) ) { | 178 | while ( count > ( mExtraViews.count() + 1 ) ) { |
169 | KDateNavigator *n = new KDateNavigator( this ); | 179 | KDateNavigator *n = new KDateNavigator( this ); |
diff --git a/korganizer/kdatenavigator.cpp b/korganizer/kdatenavigator.cpp index ab9a40f..b097dc1 100644 --- a/korganizer/kdatenavigator.cpp +++ b/korganizer/kdatenavigator.cpp | |||
@@ -115,7 +115,7 @@ KDateNavigator::KDateNavigator( QWidget *parent, const char *name ) | |||
115 | // read settings from configuration file. | 115 | // read settings from configuration file. |
116 | updateConfig(); | 116 | updateConfig(); |
117 | enableRollover(FollowMonth); | 117 | enableRollover(FollowMonth); |
118 | //setFixedSize ( sizeHint() ); | 118 | mySizeHint = sizeHint(); |
119 | } | 119 | } |
120 | void KDateNavigator::slotMonthSelected( int m ) | 120 | void KDateNavigator::slotMonthSelected( int m ) |
121 | { | 121 | { |
@@ -130,7 +130,7 @@ void KDateNavigator::setCalendar( Calendar *cal ) | |||
130 | daymatrix->setCalendar( cal ); | 130 | daymatrix->setCalendar( cal ); |
131 | } | 131 | } |
132 | 132 | ||
133 | void KDateNavigator::setBaseDate( const QDate &date ) | 133 | void KDateNavigator::setBaseDate( const QDate &date , bool doRepaint ) // = true |
134 | { | 134 | { |
135 | m_MthYr = date; | 135 | m_MthYr = date; |
136 | 136 | ||
@@ -142,7 +142,8 @@ void KDateNavigator::setBaseDate( const QDate &date ) | |||
142 | mNavigatorBar->selectDates( dates ); | 142 | mNavigatorBar->selectDates( dates ); |
143 | 143 | ||
144 | daymatrix->clearSelection(); | 144 | daymatrix->clearSelection(); |
145 | daymatrix->repaint(); | 145 | if ( doRepaint ) |
146 | daymatrix->repaint(); | ||
146 | } | 147 | } |
147 | 148 | ||
148 | void KDateNavigator::enableRollover(RolloverType r) | 149 | void KDateNavigator::enableRollover(RolloverType r) |
diff --git a/korganizer/kdatenavigator.h b/korganizer/kdatenavigator.h index 56822fa..292e71c 100644 --- a/korganizer/kdatenavigator.h +++ b/korganizer/kdatenavigator.h | |||
@@ -60,10 +60,12 @@ class KDateNavigator: public QFrame | |||
60 | 60 | ||
61 | void setShowWeekNums( bool enabled ); | 61 | void setShowWeekNums( bool enabled ); |
62 | void setCalendar( Calendar * ); | 62 | void setCalendar( Calendar * ); |
63 | void setBaseDate( const QDate & ); | 63 | void setBaseDate( const QDate & , bool doRepaint = true ); |
64 | KCal::DateList selectedDates() const { return mSelectedDates; } | 64 | KCal::DateList selectedDates() const { return mSelectedDates; } |
65 | NavigatorBar *navigatorBar() const { return mNavigatorBar; } | 65 | NavigatorBar *navigatorBar() const { return mNavigatorBar; } |
66 | void setMonthSignalOffset ( int off ) { mMonthSignalOffset = off;} | 66 | void setMonthSignalOffset ( int off ) { mMonthSignalOffset = off;} |
67 | QSize yourSizeHint() { return mySizeHint; } | ||
68 | KODayMatrix *dayMatrix() { return daymatrix ;} | ||
67 | public slots: | 69 | public slots: |
68 | void selectDates( const KCal::DateList & ); | 70 | void selectDates( const KCal::DateList & ); |
69 | void updateView(); | 71 | void updateView(); |
@@ -114,6 +116,7 @@ class KDateNavigator: public QFrame | |||
114 | bool eventFilter (QObject *,QEvent *); | 116 | bool eventFilter (QObject *,QEvent *); |
115 | 117 | ||
116 | private: | 118 | private: |
119 | QSize mySizeHint; | ||
117 | int mMonthSignalOffset; | 120 | int mMonthSignalOffset; |
118 | NavigatorBar *mNavigatorBar; | 121 | NavigatorBar *mNavigatorBar; |
119 | 122 | ||
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp index a886f4a..17a8546 100644 --- a/korganizer/kodaymatrix.cpp +++ b/korganizer/kodaymatrix.cpp | |||
@@ -201,7 +201,7 @@ void KODayMatrix::setSelectedDaysFrom(const QDate& start, const QDate& end) | |||
201 | } | 201 | } |
202 | void KODayMatrix::clearSelection() | 202 | void KODayMatrix::clearSelection() |
203 | { | 203 | { |
204 | mSelEnd = mSelStart = NOSELECTION; | 204 | mSelEnd = mSelStart = NOSELECTION; |
205 | } | 205 | } |
206 | 206 | ||
207 | 207 | ||