author | zautrix <zautrix> | 2005-07-04 22:01:37 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-07-04 22:01:37 (UTC) |
commit | d7931731fcf0ffeb5b5267f25fce741ebe1ced13 (patch) (side-by-side diff) | |
tree | 87c5e91d5df7d80c6218b0f52323bfdeab24949e | |
parent | 35f1ad23e06a0f6014d98c952e8b8652b5cffc49 (diff) | |
download | kdepimpi-d7931731fcf0ffeb5b5267f25fce741ebe1ced13.zip kdepimpi-d7931731fcf0ffeb5b5267f25fce741ebe1ced13.tar.gz kdepimpi-d7931731fcf0ffeb5b5267f25fce741ebe1ced13.tar.bz2 |
next pix wech
-rw-r--r-- | korganizer/koagendaitem.cpp | 24 | ||||
-rw-r--r-- | korganizer/koagendaitem.h | 1 | ||||
-rw-r--r-- | korganizer/koagendaview.cpp | 2 |
3 files changed, 11 insertions, 16 deletions
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp index 9fe1be4..abb29f7 100644 --- a/korganizer/koagendaitem.cpp +++ b/korganizer/koagendaitem.cpp @@ -335,38 +335,41 @@ bool KOAgendaItem::eventFilter ( QObject *object, QEvent *e ) } void KOAgendaItem::repaintMe( ) { paintMe ( mSelected ); } void KOAgendaItem::paintMe( bool selected, QPainter* paint ) { if ( globalFlagBlockAgendaItemUpdate && ! selected) return; QPainter pa; if ( mSelected ) { - pa.begin( paintPixSel() ); + pa.begin( this ); } else { if ( mAllDay ) pa.begin( paintPixAllday() ); else pa.begin( paintPix() ); } int x, yy, w, h; float nfh = 7.0; x = pos().x(); w = width(); h = height (); 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(); hPaintCoord = height(); //qDebug("paintMe %s %d %d %d %d",incidence()->summary().latin1(), x, yy, width(), height()); if ( paint == 0 ) paint = &pa; bool horLayout = ( w < h ); int maxhei = mFontPixelSize+4; if ( horLayout ) maxhei += AGENDA_ICON_SIZE -4; bool small = ( h < maxhei ); @@ -461,92 +464,85 @@ void KOAgendaItem::paintMe( bool selected, QPainter* paint ) if ( ! small ) { QFontMetrics fm ( paint->font() ); paint->drawLine(dr.left(), yy+fm.height()/2, dr.right()-2, yy+fm.height()/2); } } pa.end(); } void KOAgendaItem::resizePixmap( int w , int h ) { paintPix()->resize( w, h ); - paintPixSel()->resize( w, h ); } QPixmap * KOAgendaItem::paintPix() { static QPixmap* mPaintPix = 0; if ( ! mPaintPix ) { int w = QApplication::desktop()->width(); int h = QApplication::desktop()->height(); mPaintPix = new QPixmap(w,h); } return mPaintPix ; } QPixmap * KOAgendaItem::paintPixAllday() { static QPixmap* mPaintPixA = 0; if ( ! mPaintPixA ) { int w = QApplication::desktop()->width(); int h = QApplication::desktop()->height()/3; mPaintPixA = new QPixmap(w,h); } 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 ) { if ( globalFlagBlockAgendaItemPaint ) return; if ( globalFlagBlockAgenda > 0 && globalFlagBlockAgenda < 5 ) return; int yy; if ( mAllDay ) yy = y(); else yy = mCellYTop * ( height() / cellHeight() ); int xx = x(); if ( xPaintCoord != xx || yPaintCoord != yy || wPaintCoord != width() || hPaintCoord != height()) { xPaintCoord= xx; yPaintCoord = yy; wPaintCoord = width(); hPaintCoord = height(); globalFlagBlockAgendaItemUpdate = 0; paintMe( mSelected ); //qDebug("calling paintMe "); globalFlagBlockAgendaItemUpdate = 1; + if ( mSelected ) + return; } int rx, ry, rw, rh; rx = e->rect().x(); ry = e->rect().y(); rw = e->rect().width(); rh = e->rect().height(); //qDebug(" paintevent %s %d %d %d %d", mIncidence->summary().latin1(), x(), yy, width(), height()); QPixmap* paintFrom ; if ( mSelected ) { - paintFrom = paintPixSel(); + paintMe( mSelected ); + return; } else { if ( mAllDay ) paintFrom = paintPixAllday(); else paintFrom = paintPix(); } xx += rx; if ( xx < 0 ) { rw = rw + xx; rx -= xx; xx = 0; diff --git a/korganizer/koagendaitem.h b/korganizer/koagendaitem.h index dc2316a..7103abe 100644 --- a/korganizer/koagendaitem.h +++ b/korganizer/koagendaitem.h @@ -94,25 +94,24 @@ class KOAgendaItem : public QWidget virtual bool eventFilter ( QObject *, QEvent * ); static QToolTipGroup *toolTipGroup(); QPtrList<KOAgendaItem> conflictItems(); void setConflictItems(QPtrList<KOAgendaItem>); void addConflictItem(KOAgendaItem *ci); void paintMe( bool, QPainter* painter = 0 ); void repaintMe(); static void resizePixmap( int, int ); static QPixmap * paintPix(); - static QPixmap * paintPixSel(); static QPixmap * paintPixAllday(); void updateItem(); void computeText(); void recreateIncidence(); bool checkLayout(); void initColor (); public slots: bool updateIcons( QPainter *, bool ); void select(bool=true); protected: void dragEnterEvent(QDragEnterEvent *e); diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index 5a63b35..f811fba 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp @@ -594,25 +594,25 @@ void KOAgendaView::addToCalSlot(Incidence * inc, Incidence * incOld ) } void KOAgendaView::categoryChanged(Incidence * inc) { mAgenda->categoryChanged( inc ); mAllDayAgenda->categoryChanged( inc ); } KOAgendaView::~KOAgendaView() { delete mAllAgendaPopup; //delete mAllDayAgendaPopup; delete KOAgendaItem::paintPix(); - delete KOAgendaItem::paintPixSel(); + delete KOAgendaItem::paintPixAllday(); } void KOAgendaView::resizeEvent( QResizeEvent* e ) { //qDebug("KOAgendaView::resizeEvent( QResizeEvent* e ) %d ", e->size().width()); bool uc = false; int ow = e->oldSize().width(); int oh = e->oldSize().height(); int w = e->size().width(); int h = e->size().height(); if ( (ow > oh && w< h ) || (ow < oh && w > h ) ) { if ( ! mBlockUpdating && !globalFlagBlockStartup && !globalFlagBlockAgenda ) uc = true; |