summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-03-19 22:08:13 (UTC)
committer zautrix <zautrix>2005-03-19 22:08:13 (UTC)
commit39b719bdc75d95913c3aaf9a03aaa57b1161cc61 (patch) (side-by-side diff)
tree495c1ff6a43c45f12ff479e527bb5c0ba4787b6b /korganizer
parent6c913e8e5fb19ef3c5a74b94757aeabb9b808cc4 (diff)
downloadkdepimpi-39b719bdc75d95913c3aaf9a03aaa57b1161cc61.zip
kdepimpi-39b719bdc75d95913c3aaf9a03aaa57b1161cc61.tar.gz
kdepimpi-39b719bdc75d95913c3aaf9a03aaa57b1161cc61.tar.bz2
fix
Diffstat (limited to 'korganizer') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/calendarview.cpp50
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
@@ -346,15 +346,15 @@ void CalendarView::init()
if ( KOPrefs::instance()->mVerticalScreen ) {
mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() );
//mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() );
- //mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() );
+ mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() );
//leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() );
} else {
mDateNavigator->setFixedWidth( mDateNavigator->sizeHint().width() );
- //mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() );
+ mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() );
//leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() );
}
if ( !KOPrefs::instance()->mShowDateNavigator)
- mLeftFrame->toggle();
+ mDateNavigator->hide();
//qDebug("Calendarview Size %d %d ", width(), height());
#endif
@@ -1821,6 +1821,42 @@ void CalendarView::readSettings()
readFilterSettings(config);
config->setGroup( "Views" );
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();
else if ( dateCount == 7 ) mNavigator->selectWeek();
else mNavigator->selectDates( dateCount );
@@ -1901,6 +1937,9 @@ void CalendarView::writeSettings()
config->setGroup( "Views" );
config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() );
+ QValueList<int> list = mLeftFrame->sizes();
+ config->writeEntry("Left Splitter Frame",list);
+
#ifdef DESKTOP_VERSION
config->setGroup("WidgetLayout");
QStringList list ;//= config->readListEntry("MainLayout");
@@ -3714,14 +3753,11 @@ KDateNavigator* CalendarView::dateNavigatorWidget()
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 )
mDateNavigator->hide();
else
mDateNavigator->show();
-#endif
}
void CalendarView::addView(KOrg::BaseView *view)
{