-rw-r--r-- | korganizer/calendarview.cpp | 2 | ||||
-rw-r--r-- | korganizer/datenavigatorcontainer.cpp | 40 | ||||
-rw-r--r-- | korganizer/datenavigatorcontainer.h | 2 | ||||
-rw-r--r-- | korganizer/kdatenavigator.cpp | 3 |
4 files changed, 32 insertions, 15 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 9a4e719..6ed6a1c 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -1919,5 +1919,4 @@ void CalendarView::readSettings() } mMainFrame->setSizes(sizes); - if ( dateCount == 5 ) mNavigator->selectWorkWeek(); else if ( dateCount == 7 ) mNavigator->selectWeek(); @@ -1927,4 +1926,5 @@ void CalendarView::readSettings() globalFlagBlockAgenda = 2; mViewManager->readSettings( config ); + QTimer::singleShot( 1, mDateNavigator, SLOT ( setResizeEnabled() ) ); } diff --git a/korganizer/datenavigatorcontainer.cpp b/korganizer/datenavigatorcontainer.cpp index 2290c53..11dc592 100644 --- a/korganizer/datenavigatorcontainer.cpp +++ b/korganizer/datenavigatorcontainer.cpp @@ -41,8 +41,9 @@ DateNavigatorContainer::DateNavigatorContainer( QWidget *parent, mHorizontalCount( 1 ), mVerticalCount( 1 ) { + mResizeEnabled = false; mExtraViews.setAutoDelete( true ); mNavigatorView = new KDateNavigator( this, name ); - + mNavigatorView->hide(); connectNavigatorView( mNavigatorView ); //setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) ); @@ -219,15 +220,8 @@ void DateNavigatorContainer::checkUpdateDayMatrixDates() n->setCalendar( mCalendar ); connectNavigatorView( n ); - n->show(); - } - int iii = 0; - while ( iii < ( mExtraViews.count() ) ) { - if ( iii < count-1 ) - mExtraViews.at( iii )->show(); - else - mExtraViews.at( iii )->hide(); - ++iii; + // n->show(); } + setBaseDates(); if ( fontchange ) { @@ -267,4 +261,14 @@ void DateNavigatorContainer::checkUpdateDayMatrixDates() y * theight, twidth, theight ); } + int iii = 0; + int ccc = mHorizontalCount * mVerticalCount; + mNavigatorView->show(); + while ( iii < ( mExtraViews.count() ) ) { + if ( iii < ccc-1 ) + mExtraViews.at( iii )->show(); + else + mExtraViews.at( iii )->hide(); + ++iii; + } } @@ -394,12 +398,22 @@ void DateNavigatorContainer::setBaseDates() } } - +void DateNavigatorContainer::setResizeEnabled() +{ + mResizeEnabled = true; + //qDebug("DateNavigatorContainer::setResizeEnabled "); + checkUpdateDayMatrixDates(); +} void DateNavigatorContainer::resizeEvent( QResizeEvent * e ) { - + //qDebug("DateNavigatorContainer::resizeEvent %d %d ", width(), height()); //qDebug("COUNT %d ", mExtraViews.count()); - + if ( ! mResizeEnabled ) { + //qDebug("NOT ResizeEnabled"); + return; + } + else mUpdateTimer->start( 250 ); + //updateDayMatrixDates(); } diff --git a/korganizer/datenavigatorcontainer.h b/korganizer/datenavigatorcontainer.h index d2f397d..ac9745d 100644 --- a/korganizer/datenavigatorcontainer.h +++ b/korganizer/datenavigatorcontainer.h @@ -64,4 +64,5 @@ class DateNavigatorContainer: public QWidget void slotgoNextYear(); void slotgoPrevYear(); + void setResizeEnabled(); signals: @@ -90,4 +91,5 @@ class DateNavigatorContainer: public QWidget private: + bool mResizeEnabled; QTimer* mUpdateTimer; int mLastDisplayedDN; diff --git a/korganizer/kdatenavigator.cpp b/korganizer/kdatenavigator.cpp index 0cb767f..5eccfd6 100644 --- a/korganizer/kdatenavigator.cpp +++ b/korganizer/kdatenavigator.cpp @@ -120,5 +120,5 @@ KDateNavigator::KDateNavigator( QWidget *parent, const char *name ) myFullSizeHint = sizeHintTwoButtons( 4 ); mFontChanged = false; - resize ( 3,3 ); + //resize ( 3,3 ); } @@ -372,4 +372,5 @@ void KDateNavigator::updateConfig() void KDateNavigator::setShowWeekNums(bool enabled) { + qDebug("KDateNavigator::setShowWeekNums***************************** "); m_bShowWeekNums = enabled; for(int i=0; i<6; i++) { |