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/datenavigatorcontainer.cpp | |
parent | 39b719bdc75d95913c3aaf9a03aaa57b1161cc61 (diff) | |
download | kdepimpi-84c18843bbd1203878367572d3a6800a0586c7f1.zip kdepimpi-84c18843bbd1203878367572d3a6800a0586c7f1.tar.gz kdepimpi-84c18843bbd1203878367572d3a6800a0586c7f1.tar.bz2 |
mochn fix
Diffstat (limited to 'korganizer/datenavigatorcontainer.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | korganizer/datenavigatorcontainer.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/korganizer/datenavigatorcontainer.cpp b/korganizer/datenavigatorcontainer.cpp index 3f6e29b..d09f484 100644 --- a/korganizer/datenavigatorcontainer.cpp +++ b/korganizer/datenavigatorcontainer.cpp | |||
@@ -106,85 +106,95 @@ void DateNavigatorContainer::updateToday() | |||
106 | } | 106 | } |
107 | 107 | ||
108 | void DateNavigatorContainer::updateView() | 108 | void DateNavigatorContainer::updateView() |
109 | { | 109 | { |
110 | mNavigatorView->updateView(); | 110 | mNavigatorView->updateView(); |
111 | KDateNavigator *n; | 111 | KDateNavigator *n; |
112 | for( n = mExtraViews.first(); n; n = mExtraViews.next() ) { | 112 | for( n = mExtraViews.first(); n; n = mExtraViews.next() ) { |
113 | n->updateView(); | 113 | n->updateView(); |
114 | } | 114 | } |
115 | } | 115 | } |
116 | 116 | ||
117 | void DateNavigatorContainer::updateConfig() | 117 | void DateNavigatorContainer::updateConfig() |
118 | { | 118 | { |
119 | mNavigatorView->updateConfig(); | 119 | mNavigatorView->updateConfig(); |
120 | KDateNavigator *n; | 120 | KDateNavigator *n; |
121 | for( n = mExtraViews.first(); n; n = mExtraViews.next() ) { | 121 | for( n = mExtraViews.first(); n; n = mExtraViews.next() ) { |
122 | n->updateConfig(); | 122 | n->updateConfig(); |
123 | } | 123 | } |
124 | } | 124 | } |
125 | 125 | ||
126 | void DateNavigatorContainer::selectDates( const DateList &dateList ) | 126 | 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() |
133 | { | 138 | { |
134 | KCal::DateList dateList = mNavigatorView->selectedDates(); | 139 | KCal::DateList dateList = mNavigatorView->selectedDates(); |
135 | if ( dateList.isEmpty() ) { | 140 | if ( dateList.isEmpty() ) { |
136 | kdError() << "DateNavigatorContainer::selectDates() empty list." << endl; | 141 | kdError() << "DateNavigatorContainer::selectDates() empty list." << endl; |
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; |
150 | kdDebug(5850) << " CURRENT SIZE: " << size() << endl; | 157 | kdDebug(5850) << " CURRENT SIZE: " << size() << endl; |
151 | kdDebug(5850) << " MINIMUM SIZEHINT: " << minimumSizeHint() << endl; | 158 | kdDebug(5850) << " MINIMUM SIZEHINT: " << minimumSizeHint() << endl; |
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 ); |
170 | n->setMonthSignalOffset ( mExtraViews.count()+1 ); | 180 | n->setMonthSignalOffset ( mExtraViews.count()+1 ); |
171 | mExtraViews.append( n ); | 181 | mExtraViews.append( n ); |
172 | n->setCalendar( mCalendar ); | 182 | n->setCalendar( mCalendar ); |
173 | setBaseDates(); | 183 | setBaseDates(); |
174 | connectNavigatorView( n ); | 184 | connectNavigatorView( n ); |
175 | n->show(); | 185 | n->show(); |
176 | } | 186 | } |
177 | 187 | ||
178 | while ( count < ( mExtraViews.count() + 1 ) ) { | 188 | while ( count < ( mExtraViews.count() + 1 ) ) { |
179 | mExtraViews.removeLast(); | 189 | mExtraViews.removeLast(); |
180 | } | 190 | } |
181 | 191 | ||
182 | mHorizontalCount = horizontalCount; | 192 | mHorizontalCount = horizontalCount; |
183 | mVerticalCount = verticalCount; | 193 | mVerticalCount = verticalCount; |
184 | } | 194 | } |
185 | 195 | ||
186 | int height = size().height() / verticalCount; | 196 | int height = size().height() / verticalCount; |
187 | int width = size().width() / horizontalCount; | 197 | int width = size().width() / horizontalCount; |
188 | 198 | ||
189 | NavigatorBar *bar = mNavigatorView->navigatorBar(); | 199 | NavigatorBar *bar = mNavigatorView->navigatorBar(); |
190 | if ( horizontalCount > 1 ) bar->showButtons( true, false ); | 200 | if ( horizontalCount > 1 ) bar->showButtons( true, false ); |