-rw-r--r-- | korganizer/koagendaitem.cpp | 5 | ||||
-rw-r--r-- | korganizer/koagendaitem.h | 1 |
2 files changed, 3 insertions, 3 deletions
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp index 1be0aca..e660c32 100644 --- a/korganizer/koagendaitem.cpp +++ b/korganizer/koagendaitem.cpp | |||
@@ -126,25 +126,25 @@ void KOAgendaItem::init ( Incidence *incidence, QDate qd ) | |||
126 | mBackgroundColor = *KOPrefs::instance()->categoryColor(cat); | 126 | mBackgroundColor = *KOPrefs::instance()->categoryColor(cat); |
127 | if ( (incidence->typeID() == todoID ) &&((static_cast<Todo*>(incidence))->isCompleted()) ) { | 127 | if ( (incidence->typeID() == todoID ) &&((static_cast<Todo*>(incidence))->isCompleted()) ) { |
128 | if ( mBackgroundColor == KOPrefs::instance()->mEventColor ) | 128 | if ( mBackgroundColor == KOPrefs::instance()->mEventColor ) |
129 | mBackgroundColor = KOPrefs::instance()->mTodoDoneColor; | 129 | mBackgroundColor = KOPrefs::instance()->mTodoDoneColor; |
130 | } | 130 | } |
131 | } | 131 | } |
132 | 132 | ||
133 | } | 133 | } |
134 | mColorGroup = QColorGroup( mBackgroundColor.light(), | 134 | mColorGroup = QColorGroup( mBackgroundColor.light(), |
135 | mBackgroundColor.dark(),mBackgroundColor.light(), | 135 | mBackgroundColor.dark(),mBackgroundColor.light(), |
136 | mBackgroundColor.dark(),mBackgroundColor, black, mBackgroundColor) ; | 136 | mBackgroundColor.dark(),mBackgroundColor, black, mBackgroundColor) ; |
137 | setBackgroundColor( mBackgroundColor ); | 137 | setBackgroundColor( mBackgroundColor ); |
138 | 138 | mWhiteText = (mBackgroundColor.red() + mBackgroundColor.green() + mBackgroundColor.blue() < 250); | |
139 | mConflictItems.clear(); | 139 | mConflictItems.clear(); |
140 | setCellXY(0,0,1); | 140 | setCellXY(0,0,1); |
141 | setCellXWidth(0); | 141 | setCellXWidth(0); |
142 | setSubCell(0); | 142 | setSubCell(0); |
143 | setSubCells(1); | 143 | setSubCells(1); |
144 | setMultiItem(0,0,0); | 144 | setMultiItem(0,0,0); |
145 | startMove(); | 145 | startMove(); |
146 | mSelected = true; | 146 | mSelected = true; |
147 | select(false); | 147 | select(false); |
148 | QFontMetrics fontinf(KOPrefs::instance()->mAgendaViewFont); | 148 | QFontMetrics fontinf(KOPrefs::instance()->mAgendaViewFont); |
149 | mFontPixelSize = fontinf.height();; | 149 | mFontPixelSize = fontinf.height();; |
150 | hide(); | 150 | hide(); |
@@ -396,26 +396,25 @@ void KOAgendaItem::paintMe( bool selected, QPainter* paint ) | |||
396 | align = ( AlignLeft|BreakAnywhere|WordBreak|AlignTop); | 396 | align = ( AlignLeft|BreakAnywhere|WordBreak|AlignTop); |
397 | #endif | 397 | #endif |
398 | if ( addIcon ) { | 398 | if ( addIcon ) { |
399 | if ( ! horLayout ) { | 399 | if ( ! horLayout ) { |
400 | x += AGENDA_ICON_SIZE+3; | 400 | x += AGENDA_ICON_SIZE+3; |
401 | w -= (AGENDA_ICON_SIZE+3); | 401 | w -= (AGENDA_ICON_SIZE+3); |
402 | } | 402 | } |
403 | else { | 403 | else { |
404 | yy+= AGENDA_ICON_SIZE+2; | 404 | yy+= AGENDA_ICON_SIZE+2; |
405 | h -=(AGENDA_ICON_SIZE+3); | 405 | h -=(AGENDA_ICON_SIZE+3); |
406 | } | 406 | } |
407 | } | 407 | } |
408 | int colsum = mBackgroundColor.red() + mBackgroundColor.green() + mBackgroundColor.blue(); | 408 | if ( mWhiteText ) |
409 | if ( colsum < 250 ) | ||
410 | paint->setPen ( white); | 409 | paint->setPen ( white); |
411 | if ( x < 0 ) { | 410 | if ( x < 0 ) { |
412 | w = w+x-3; | 411 | w = w+x-3; |
413 | x = 3; | 412 | x = 3; |
414 | if ( w > parentWidget()->width() ){ | 413 | if ( w > parentWidget()->width() ){ |
415 | w = parentWidget()->width() - 6; | 414 | w = parentWidget()->width() - 6; |
416 | #ifndef DESKTOP_VERSION | 415 | #ifndef DESKTOP_VERSION |
417 | align = ( AlignHCenter|WordBreak|AlignTop); | 416 | align = ( AlignHCenter|WordBreak|AlignTop); |
418 | #else | 417 | #else |
419 | align = ( AlignHCenter|BreakAnywhere|WordBreak|AlignTop); | 418 | align = ( AlignHCenter|BreakAnywhere|WordBreak|AlignTop); |
420 | #endif | 419 | #endif |
421 | 420 | ||
diff --git a/korganizer/koagendaitem.h b/korganizer/koagendaitem.h index 53658c0..d1b1940 100644 --- a/korganizer/koagendaitem.h +++ b/korganizer/koagendaitem.h | |||
@@ -113,24 +113,25 @@ class KOAgendaItem : public QWidget | |||
113 | bool updateIcons( QPainter *, bool ); | 113 | bool updateIcons( QPainter *, bool ); |
114 | void select(bool=true); | 114 | void select(bool=true); |
115 | 115 | ||
116 | protected: | 116 | protected: |
117 | void dragEnterEvent(QDragEnterEvent *e); | 117 | void dragEnterEvent(QDragEnterEvent *e); |
118 | void dropEvent(QDropEvent *e); | 118 | void dropEvent(QDropEvent *e); |
119 | void paintEvent ( QPaintEvent * ); | 119 | void paintEvent ( QPaintEvent * ); |
120 | void resizeEvent ( QResizeEvent *ev ); | 120 | void resizeEvent ( QResizeEvent *ev ); |
121 | 121 | ||
122 | private: | 122 | private: |
123 | KOAgendaItemWhatsThis* mKOAgendaItemWhatsThis; | 123 | KOAgendaItemWhatsThis* mKOAgendaItemWhatsThis; |
124 | bool mAllDay; | 124 | bool mAllDay; |
125 | bool mWhiteText; | ||
125 | int mCellX; | 126 | int mCellX; |
126 | int mCellXWidth; | 127 | int mCellXWidth; |
127 | int mCellYTop,mCellYBottom; | 128 | int mCellYTop,mCellYBottom; |
128 | int mSubCell; // subcell number of this item | 129 | int mSubCell; // subcell number of this item |
129 | int mSubCells; // Total number of subcells in cell of this item | 130 | int mSubCells; // Total number of subcells in cell of this item |
130 | int xPaintCoord; | 131 | int xPaintCoord; |
131 | int yPaintCoord; | 132 | int yPaintCoord; |
132 | int wPaintCoord; | 133 | int wPaintCoord; |
133 | int hPaintCoord; | 134 | int hPaintCoord; |
134 | // Variables to remember start position | 135 | // Variables to remember start position |
135 | int mStartCellX; | 136 | int mStartCellX; |
136 | int mStartCellXWidth; | 137 | int mStartCellXWidth; |