summaryrefslogtreecommitdiffabout
path: root/korganizer/datenavigatorcontainer.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/datenavigatorcontainer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/datenavigatorcontainer.cpp20
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
@@ -127,6 +127,11 @@ void DateNavigatorContainer::selectDates( const DateList &dateList )
{
mNavigatorView->selectDates( dateList );
setBaseDates();
+ if ( mExtraViews.count() ) {
+ KDateNavigator *view = mExtraViews.at( 0 );
+ view->dayMatrix()->setSelectedDaysFrom(*(dateList.begin()), *(--dateList.end()));
+ view->dayMatrix()->repaint();
+ }
}
void DateNavigatorContainer::setBaseDates()
@@ -137,13 +142,15 @@ void DateNavigatorContainer::setBaseDates()
}
QDate baseDate = dateList.first();
KDateNavigator *n;
+ bool doRepaint = false; // skip first repaint
for( n = mExtraViews.first(); n; n = mExtraViews.next() ) {
baseDate = baseDate.addDays( baseDate.daysInMonth () );
- n->setBaseDate( baseDate );
+ n->setBaseDate( baseDate, doRepaint );
+ doRepaint = true;
}
}
-void DateNavigatorContainer::resizeEvent( QResizeEvent * )
+void DateNavigatorContainer::resizeEvent( QResizeEvent * e )
{
#if 0
kdDebug(5850) << "DateNavigatorContainer::resizeEvent()" << endl;
@@ -152,18 +159,21 @@ void DateNavigatorContainer::resizeEvent( QResizeEvent * )
kdDebug(5850) << " SIZEHINT: " << sizeHint() << endl;
kdDebug(5850) << " MINIMUM SIZE: " << minimumSize() << endl;
#endif
-
- QSize minSize = mNavigatorView->minimumSizeHint();
+ QSize minSize = mNavigatorView->yourSizeHint();
// kdDebug(5850) << " NAVIGATORVIEW minimumSizeHint: " << minSize << endl;
int verticalCount = size().height() / minSize.height();
int horizontalCount = size().width() / minSize.width();
+ //qDebug(" wattdatt %d new %d %d ", size().width() ,e->size().width() , minSize.width() );
//qDebug("COUNT %d %d %d %d ", verticalCount, horizontalCount , mVerticalCount, mHorizontalCount );
if ( horizontalCount != mHorizontalCount ||
verticalCount != mVerticalCount ) {
uint count = horizontalCount * verticalCount;
- if ( count == 0 ) return;
+ if ( count == 0 ) {
+ mNavigatorView->resize( minSize );
+ return;
+ }
while ( count > ( mExtraViews.count() + 1 ) ) {
KDateNavigator *n = new KDateNavigator( this );