From d7931731fcf0ffeb5b5267f25fce741ebe1ced13 Mon Sep 17 00:00:00 2001 From: zautrix Date: Mon, 04 Jul 2005 22:01:37 +0000 Subject: next pix wech --- (limited to 'korganizer') 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(); diff --git a/korganizer/koagendaitem.h b/korganizer/koagendaitem.h index dc2316a..7103abe 100644 --- a/korganizer/koagendaitem.h +++ b/korganizer/koagendaitem.h @@ -103,7 +103,6 @@ class KOAgendaItem : public QWidget void repaintMe(); static void resizePixmap( int, int ); static QPixmap * paintPix(); - static QPixmap * paintPixSel(); static QPixmap * paintPixAllday(); void updateItem(); void computeText(); diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index 5a63b35..f811fba 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp @@ -603,7 +603,7 @@ KOAgendaView::~KOAgendaView() delete mAllAgendaPopup; //delete mAllDayAgendaPopup; delete KOAgendaItem::paintPix(); - delete KOAgendaItem::paintPixSel(); + delete KOAgendaItem::paintPixAllday(); } void KOAgendaView::resizeEvent( QResizeEvent* e ) { -- cgit v0.9.0.2