-rw-r--r-- | korganizer/komonthview.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 96f2502..2150654 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp | |||
@@ -721,32 +721,34 @@ int MonthViewCell::insertEvent(Event *event) | |||
721 | item->recycle( event, mDate, text ); | 721 | item->recycle( event, mDate, text ); |
722 | } else { | 722 | } else { |
723 | item = new MonthViewItem( event, mDate, text ); | 723 | item = new MonthViewItem( event, mDate, text ); |
724 | } | 724 | } |
725 | 725 | ||
726 | QPalette pal; | 726 | QPalette pal; |
727 | if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { | 727 | if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { |
728 | QStringList categories = event->categories(); | 728 | QStringList categories = event->categories(); |
729 | QString cat = categories.first(); | 729 | QString cat = categories.first(); |
730 | if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { | 730 | if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { |
731 | pal = getPalette(); | 731 | pal = getPalette(); |
732 | if (cat.isEmpty()) { | 732 | if (cat.isEmpty()) { |
733 | pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); | 733 | //pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); |
734 | pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->defaultColor( event->calID() )); | ||
734 | } else { | 735 | } else { |
735 | pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); | 736 | pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); |
736 | } | 737 | } |
737 | 738 | ||
738 | } else { | 739 | } else { |
739 | if (cat.isEmpty()) { | 740 | if (cat.isEmpty()) { |
740 | pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); | 741 | //pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); |
742 | pal = QPalette( KOPrefs::instance()->defaultColor( event->calID() ), KOPrefs::instance()->defaultColor( event->calID() )); | ||
741 | } else { | 743 | } else { |
742 | pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); | 744 | pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); |
743 | } | 745 | } |
744 | } | 746 | } |
745 | 747 | ||
746 | } else { | 748 | } else { |
747 | pal = mStandardPalette ; | 749 | pal = mStandardPalette ; |
748 | } | 750 | } |
749 | item->setPalette( pal ); | 751 | item->setPalette( pal ); |
750 | item->setRecur( event->recurrence()->doesRecur() ); | 752 | item->setRecur( event->recurrence()->doesRecur() ); |
751 | item->setAlarm( event->isAlarmEnabled() && multiday < 2 && event->alarmEnabled() ); | 753 | item->setAlarm( event->isAlarmEnabled() && multiday < 2 && event->alarmEnabled() ); |
752 | item->setMoreInfo( event->description().length() > 0 ); | 754 | item->setMoreInfo( event->description().length() > 0 ); |
@@ -802,32 +804,34 @@ void MonthViewCell::insertTodo(Todo *todo) | |||
802 | } else { | 804 | } else { |
803 | item = new MonthViewItem( todo, mDate, text ); | 805 | item = new MonthViewItem( todo, mDate, text ); |
804 | } | 806 | } |
805 | //MonthViewItem *item = new MonthViewItem( todo, mDate, text ); | 807 | //MonthViewItem *item = new MonthViewItem( todo, mDate, text ); |
806 | //item->setPalette( mStandardPalette ); | 808 | //item->setPalette( mStandardPalette ); |
807 | QPalette pal; | 809 | QPalette pal; |
808 | if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { | 810 | if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { |
809 | QStringList categories = todo->categories(); | 811 | QStringList categories = todo->categories(); |
810 | QString cat = categories.first(); | 812 | QString cat = categories.first(); |
811 | if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { | 813 | if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { |
812 | pal = getPalette(); | 814 | pal = getPalette(); |
813 | if (cat.isEmpty()) { | 815 | if (cat.isEmpty()) { |
814 | pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); | 816 | //pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); |
817 | pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->defaultColor( todo->calID() )); | ||
815 | } else { | 818 | } else { |
816 | pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); | 819 | pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); |
817 | } | 820 | } |
818 | 821 | ||
819 | } else { | 822 | } else { |
820 | if (cat.isEmpty()) { | 823 | if (cat.isEmpty()) { |
821 | pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); | 824 | //pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); |
825 | pal = QPalette(KOPrefs::instance()->defaultColor( todo->calID() ), KOPrefs::instance()->defaultColor( todo->calID() )); | ||
822 | } else { | 826 | } else { |
823 | pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); | 827 | pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); |
824 | } | 828 | } |
825 | } | 829 | } |
826 | 830 | ||
827 | } else { | 831 | } else { |
828 | pal = mStandardPalette ; | 832 | pal = mStandardPalette ; |
829 | } | 833 | } |
830 | item->setPalette( pal ); | 834 | item->setPalette( pal ); |
831 | item->setRecur( todo->recurrence()->doesRecur() ); | 835 | item->setRecur( todo->recurrence()->doesRecur() ); |
832 | item->setAlarm( todo->isAlarmEnabled() && todo->alarmEnabled() ); | 836 | item->setAlarm( todo->isAlarmEnabled() && todo->alarmEnabled() ); |
833 | item->setMoreInfo( todo->description().length() > 0 ); | 837 | item->setMoreInfo( todo->description().length() > 0 ); |