From 84c18843bbd1203878367572d3a6800a0586c7f1 Mon Sep 17 00:00:00 2001 From: zautrix Date: Sat, 19 Mar 2005 22:56:08 +0000 Subject: mochn fix --- (limited to 'korganizer') 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() sizes << 100; } mLeftFrame->setSizes(sizes); - qDebug("sizes count %d ", sizes.count()); if ( dateCount == 5 ) mNavigator->selectWorkWeek(); else if ( dateCount == 7 ) mNavigator->selectWeek(); 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 ) { 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 ); 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 ) // read settings from configuration file. updateConfig(); enableRollover(FollowMonth); - //setFixedSize ( sizeHint() ); + mySizeHint = sizeHint(); } void KDateNavigator::slotMonthSelected( int m ) { @@ -130,7 +130,7 @@ void KDateNavigator::setCalendar( Calendar *cal ) daymatrix->setCalendar( cal ); } -void KDateNavigator::setBaseDate( const QDate &date ) +void KDateNavigator::setBaseDate( const QDate &date , bool doRepaint ) // = true { m_MthYr = date; @@ -142,7 +142,8 @@ void KDateNavigator::setBaseDate( const QDate &date ) mNavigatorBar->selectDates( dates ); daymatrix->clearSelection(); - daymatrix->repaint(); + if ( doRepaint ) + daymatrix->repaint(); } 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 void setShowWeekNums( bool enabled ); void setCalendar( Calendar * ); - void setBaseDate( const QDate & ); + void setBaseDate( const QDate & , bool doRepaint = true ); KCal::DateList selectedDates() const { return mSelectedDates; } NavigatorBar *navigatorBar() const { return mNavigatorBar; } void setMonthSignalOffset ( int off ) { mMonthSignalOffset = off;} + QSize yourSizeHint() { return mySizeHint; } + KODayMatrix *dayMatrix() { return daymatrix ;} public slots: void selectDates( const KCal::DateList & ); void updateView(); @@ -114,6 +116,7 @@ class KDateNavigator: public QFrame bool eventFilter (QObject *,QEvent *); private: + QSize mySizeHint; int mMonthSignalOffset; NavigatorBar *mNavigatorBar; 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) } void KODayMatrix::clearSelection() { - mSelEnd = mSelStart = NOSELECTION; + mSelEnd = mSelStart = NOSELECTION; } -- cgit v0.9.0.2