summaryrefslogtreecommitdiffabout
path: root/korganizer/koagendaitem.cpp
authorzautrix <zautrix>2005-07-04 22:01:37 (UTC)
committer zautrix <zautrix>2005-07-04 22:01:37 (UTC)
commitd7931731fcf0ffeb5b5267f25fce741ebe1ced13 (patch) (side-by-side diff)
tree87c5e91d5df7d80c6218b0f52323bfdeab24949e /korganizer/koagendaitem.cpp
parent35f1ad23e06a0f6014d98c952e8b8652b5cffc49 (diff)
downloadkdepimpi-d7931731fcf0ffeb5b5267f25fce741ebe1ced13.zip
kdepimpi-d7931731fcf0ffeb5b5267f25fce741ebe1ced13.tar.gz
kdepimpi-d7931731fcf0ffeb5b5267f25fce741ebe1ced13.tar.bz2
next pix wech
Diffstat (limited to 'korganizer/koagendaitem.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagendaitem.cpp24
1 files changed, 10 insertions, 14 deletions
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp
index 9fe1be4..abb29f7 100644
--- a/korganizer/koagendaitem.cpp
+++ b/korganizer/koagendaitem.cpp
@@ -344,7 +344,7 @@ void KOAgendaItem::paintMe( bool selected, QPainter* paint )
QPainter pa;
if ( mSelected ) {
- pa.begin( paintPixSel() );
+ pa.begin( this );
} else {
if ( mAllDay )
pa.begin( paintPixAllday() );
@@ -357,7 +357,10 @@ void KOAgendaItem::paintMe( bool selected, QPainter* paint )
if ( mAllDay )
yy = y();
else
- yy = mCellYTop * ( height() / cellHeight() );
+ yy = mCellYTop * ( height() / cellHeight() );
+ if ( mSelected ) {
+ pa.translate( -x, -yy );
+ }
xPaintCoord= x;
yPaintCoord = yy;
wPaintCoord = width();
@@ -470,7 +473,6 @@ void KOAgendaItem::paintMe( bool selected, QPainter* paint )
void KOAgendaItem::resizePixmap( int w , int h )
{
paintPix()->resize( w, h );
- paintPixSel()->resize( w, h );
}
QPixmap * KOAgendaItem::paintPix()
@@ -493,16 +495,7 @@ QPixmap * KOAgendaItem::paintPixAllday()
}
return mPaintPixA ;
}
-QPixmap * KOAgendaItem::paintPixSel()
-{
- static QPixmap* mPaintPixSel = 0;
- if ( ! mPaintPixSel ) {
- int w = QApplication::desktop()->width();
- int h = QApplication::desktop()->height();
- mPaintPixSel = new QPixmap(w,h);
- }
- return mPaintPixSel ;
-}
+
void KOAgendaItem::paintEvent ( QPaintEvent *e )
{
@@ -527,6 +520,8 @@ void KOAgendaItem::paintEvent ( QPaintEvent *e )
paintMe( mSelected );
//qDebug("calling paintMe ");
globalFlagBlockAgendaItemUpdate = 1;
+ if ( mSelected )
+ return;
}
int rx, ry, rw, rh;
rx = e->rect().x();
@@ -537,7 +532,8 @@ void KOAgendaItem::paintEvent ( QPaintEvent *e )
QPixmap* paintFrom ;
if ( mSelected ) {
- paintFrom = paintPixSel();
+ paintMe( mSelected );
+ return;
} else {
if ( mAllDay )
paintFrom = paintPixAllday();