summaryrefslogtreecommitdiffabout
path: root/korganizer/komonthview.cpp
authorzautrix <zautrix>2005-06-27 19:29:38 (UTC)
committer zautrix <zautrix>2005-06-27 19:29:38 (UTC)
commitd730e4b5cd81965f224b69efcc91dd58253f0b98 (patch) (side-by-side diff)
tree38874ec3d889bee7ab12a79a1ef690e6c47aac5f /korganizer/komonthview.cpp
parent427221638f1e652bd57a37835a1de0134266c3f7 (diff)
downloadkdepimpi-d730e4b5cd81965f224b69efcc91dd58253f0b98.zip
kdepimpi-d730e4b5cd81965f224b69efcc91dd58253f0b98.tar.gz
kdepimpi-d730e4b5cd81965f224b69efcc91dd58253f0b98.tar.bz2
fixes
Diffstat (limited to 'korganizer/komonthview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/komonthview.cpp57
1 files changed, 16 insertions, 41 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index 00e5a6f..aeb3974 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -280,19 +280,10 @@ void KNoScrollListBox::mousePressEvent(QMouseEvent *e)
-MonthViewItem::MonthViewItem( Incidence *incidence, QDate qd, const QString & s)
+MonthViewItem::MonthViewItem( Incidence *incidence, const QString & s)
: QListBoxItem()
{
- mDisplayHightlighted = false;
mblockRepaint = true;
- setText( s );
- mMultiday = 0;
- mIncidence = incidence;
- mDate = qd;
- mRecur = false;
- mAlarm = false;
- mReply = false;
- mInfo = false;
- mdayPos = 0;
isWeekItem = KOPrefs::instance()->mMonthViewWeek;
+ recycle( incidence, s );
}
-void MonthViewItem::recycle( Incidence *incidence, QDate qd, const QString & s)
+void MonthViewItem::recycle( Incidence *incidence, const QString & s)
{
@@ -302,15 +293,2 @@ void MonthViewItem::recycle( Incidence *incidence, QDate qd, const QString & s)
mIncidence = incidence;
- mDate = qd;
- mRecur = false;
- mAlarm = false;
- mReply = false;
- mInfo = false;
- mdayPos = 0;
-}
-void MonthViewItem::clearData()
-{
- mDisplayHightlighted = false;
- setText( "" );
- mMultiday = 0;
- mIncidence = 0;
mRecur = false;
@@ -321,2 +299,3 @@ void MonthViewItem::clearData()
}
+
bool MonthViewItem::setHighlightedFalse()
@@ -346,3 +325,3 @@ void MonthViewItem::paint(QPainter *p)
{
- if ( mblockRepaint ) {
+ if ( mblockRepaint || !mIncidence ) {
return;
@@ -356,3 +335,3 @@ void MonthViewItem::paint(QPainter *p)
int x = 1;
- if (KOPrefs::instance()->mMonthViewUsesCategoryColor || mDisplayHightlighted )
+ if (KOPrefs::instance()->mMonthViewUsesCategoryColor || mDisplayHightlighted || sel )
{
@@ -397,3 +376,3 @@ void MonthViewItem::paint(QPainter *p)
int sizeM = size+2;
- p->setBrush( QBrush::SolidPattern );
+ p->setBrush( QBrush( p->pen().color() ) );
p->drawLine ( x+1, yyy, x +sizeM +sizeM/2-1, yyy ) ;
@@ -436,3 +415,3 @@ void MonthViewItem::paint(QPainter *p)
int val = td->percentComplete()/20;
- p->fillRect ( x+1, y-2, val ,size+4,Qt::black );
+ p->fillRect ( x+1, y-2, val ,size+4,p->pen().color() );
p->drawRect ( x, y-2,7,size+4);
@@ -670,3 +649,3 @@ void MonthViewCell::startUpdateCell()
//item->setHighlightedFalse();
- item->clearData();
+ item->recycle( 0, "");
CurrentAvailItem = (MonthViewItem *)item->next();
@@ -766,5 +745,5 @@ int MonthViewCell::insertEvent(Event *event)
mAvailItemList.remove( item );
- item->recycle( event, mDate, text );
+ item->recycle( event, text );
} else {
- item = new MonthViewItem( event, mDate, text );
+ item = new MonthViewItem( event, text );
}
@@ -796,2 +775,3 @@ int MonthViewCell::insertEvent(Event *event)
}
+ pal.setColor(QColorGroup::Highlight, KOPrefs::instance()->mHighlightColor);
item->setPalette( pal );
@@ -855,5 +835,5 @@ void MonthViewCell::insertTodo(Todo *todo)
mAvailItemList.remove( item );
- item->recycle( todo, mDate, text );
+ item->recycle( todo, text );
} else {
- item = new MonthViewItem( todo, mDate, text );
+ item = new MonthViewItem( todo, text );
}
@@ -886,2 +866,3 @@ void MonthViewCell::insertTodo(Todo *todo)
}
+ pal.setColor(QColorGroup::Highlight, KOPrefs::instance()->mHighlightColor);
item->setPalette( pal );
@@ -1025,9 +1006,3 @@ QDate MonthViewCell::selectedIncidenceDate()
if ( index < 0 ) return qd;
-
- MonthViewItem *mitem =
- static_cast<MonthViewItem *>( item( index ) );
-
- if ( !mitem ) return qd;
-
- return mitem->incidenceDate();
+ return mDate;
}