-rw-r--r-- | korganizer/calendarview.cpp | 50 |
1 files changed, 43 insertions, 7 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 00285a5..29c530b 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -348,3 +348,3 @@ void CalendarView::init() //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() ); - //mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() ); + mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() ); //leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() ); @@ -352,3 +352,3 @@ void CalendarView::init() mDateNavigator->setFixedWidth( mDateNavigator->sizeHint().width() ); - //mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() ); + mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() ); //leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() ); @@ -356,3 +356,3 @@ void CalendarView::init() if ( !KOPrefs::instance()->mShowDateNavigator) - mLeftFrame->toggle(); + mDateNavigator->hide(); //qDebug("Calendarview Size %d %d ", width(), height()); @@ -1823,2 +1823,38 @@ void CalendarView::readSettings() int dateCount = config->readNumEntry( "ShownDatesCount", 7 ); + + QValueList<int> sizes = config->readIntListEntry("Left Splitter Frame"); + + int resetval = 0; + int maxVal = 0; + if (sizes.count() != 3) { + if ( KOPrefs::instance()->mVerticalScreen ) { + resetval = mDateNavigator->sizeHint().width()+2; + } else { + resetval = mDateNavigator->sizeHint().height()+2; + } + } + if ( !resetval ){// i.e. sizes.count() == 3 + if ( KOPrefs::instance()->mVerticalScreen ) { + if ( sizes[0] < mDateNavigator->sizeHint().width()+1 ) + resetval = mDateNavigator->sizeHint().width()+2; + } else { + if ( sizes[0] < mDateNavigator->sizeHint().height()+1 ) + resetval = mDateNavigator->sizeHint().height()+2; + } + } + if ( resetval ) { + sizes.clear(); + if ( KOPrefs::instance()->mVerticalScreen ) { + maxVal = QApplication::desktop()->width() -10; + } else { + maxVal = QApplication::desktop()->height()-10; + } + sizes << resetval; + if ( maxVal < resetval + resetval) + resetval = maxVal - resetval; + sizes << resetval; + sizes << 100; + } + mLeftFrame->setSizes(sizes); + qDebug("sizes count %d ", sizes.count()); if ( dateCount == 5 ) mNavigator->selectWorkWeek(); @@ -1903,2 +1939,5 @@ void CalendarView::writeSettings() + QValueList<int> list = mLeftFrame->sizes(); + config->writeEntry("Left Splitter Frame",list); + #ifdef DESKTOP_VERSION @@ -3716,5 +3755,3 @@ void CalendarView::toggleDateNavigatorWidget() KOPrefs::instance()->mShowDateNavigator = !KOPrefs::instance()->mShowDateNavigator ; - mLeftFrame->toggle(); - // FIXME mShowDateNavigator is not the toggle state of mLeftFrame -#if 0 + if (!KOPrefs::instance()->mShowDateNavigator ) @@ -3723,3 +3760,2 @@ void CalendarView::toggleDateNavigatorWidget() mDateNavigator->show(); -#endif } |