From 13c00953a9d521873b03f861e54e83e33b30bc96 Mon Sep 17 00:00:00 2001 From: zautrix Date: Wed, 15 Jun 2005 10:22:38 +0000 Subject: fixxx --- (limited to 'korganizer') diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp index e660c32..a8e0678 100644 --- a/korganizer/koagendaitem.cpp +++ b/korganizer/koagendaitem.cpp @@ -131,9 +131,14 @@ void KOAgendaItem::init ( Incidence *incidence, QDate qd ) } } - mColorGroup = QColorGroup( mBackgroundColor.light(), - mBackgroundColor.dark(),mBackgroundColor.light(), - mBackgroundColor.dark(),mBackgroundColor, black, mBackgroundColor) ; + + QColor BackgroundColor ( mBackgroundColor ); + if ( mIncidence->calID() > 1 ) { + BackgroundColor = KOPrefs::instance()->defaultColor( mIncidence->calID() ); + } + mColorGroup = QColorGroup( BackgroundColor.light(), + BackgroundColor.dark(),BackgroundColor.light(), + BackgroundColor.dark(),BackgroundColor, black, BackgroundColor) ; setBackgroundColor( mBackgroundColor ); mWhiteText = (mBackgroundColor.red() + mBackgroundColor.green() + mBackgroundColor.blue() < 250); mConflictItems.clear(); diff --git a/korganizer/kofilterview.cpp b/korganizer/kofilterview.cpp index 52bc463..a653c18 100644 --- a/korganizer/kofilterview.cpp +++ b/korganizer/kofilterview.cpp @@ -344,12 +344,12 @@ void KOCalEditView::readConfig() connect (cb, SIGNAL (selectNum(int,bool)), SLOT ( selectReadOnly(int,bool) ) ); if ( kkf->mErrorOnLoad ) cb->setEnabled( false ); - KColorButton *colb = new KColorButton( mw ); - mainLayout->addWidget( colb,row,++iii ); - colb->setID( kkf->mCalNumber ); - colb->setColor( kkf->mDefaultColor ); - connect (colb, SIGNAL (changedID(const QColor&, int )), SLOT ( setColor(const QColor&,int) ) ); if ( row > 1) { + KColorButton *colb = new KColorButton( mw ); + mainLayout->addWidget( colb,row,++iii ); + colb->setID( kkf->mCalNumber ); + colb->setColor( kkf->mDefaultColor ); + connect (colb, SIGNAL (changedID(const QColor&, int )), SLOT ( setColor(const QColor&,int) ) ); KOCalButton* calb = new KOCalButton( mw ); mainLayout->addWidget( calb,row,++iii ); calb->setNum( kkf->mCalNumber ); diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 96f2502..2150654 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp @@ -730,14 +730,16 @@ int MonthViewCell::insertEvent(Event *event) if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { pal = getPalette(); if (cat.isEmpty()) { - pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); + //pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); + pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->defaultColor( event->calID() )); } else { pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); } } else { if (cat.isEmpty()) { - pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); + //pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); + pal = QPalette( KOPrefs::instance()->defaultColor( event->calID() ), KOPrefs::instance()->defaultColor( event->calID() )); } else { pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); } @@ -811,14 +813,16 @@ void MonthViewCell::insertTodo(Todo *todo) if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { pal = getPalette(); if (cat.isEmpty()) { - pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); + //pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); + pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->defaultColor( todo->calID() )); } else { pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); } } else { if (cat.isEmpty()) { - pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); + //pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); + pal = QPalette(KOPrefs::instance()->defaultColor( todo->calID() ), KOPrefs::instance()->defaultColor( todo->calID() )); } else { pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); } diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp index e679bd3..65f0342 100644 --- a/korganizer/koprefs.cpp +++ b/korganizer/koprefs.cpp @@ -497,6 +497,7 @@ void KOPrefs::deleteCalendar( int num ) } QColor KOPrefs::defaultColor( int calNum ) const { + if ( calNum == 1 ) return mEventColor; return (mDefCalColors[calNum-1])->mDefaultColor; } void KOPrefs::usrWriteConfig() diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp index 3ee9a22..35a56ca 100644 --- a/korganizer/koprefsdialog.cpp +++ b/korganizer/koprefsdialog.cpp @@ -1465,7 +1465,6 @@ void KOPrefsDialog::usrWriteConfig() KOPrefs::instance()->mAlarmSuspendTime = mAlarmSuspendTime->value() ; KOPrefs::instance()->mAlarmSuspendCount= mAlarmSuspendCount->value() ; KOPrefs::instance()->mAlarmBeepInterval= mAlarmBeepInterval->value() ; - } void KOPrefsDialog::updateCategories() -- cgit v0.9.0.2