-rw-r--r-- | korganizer/koagenda.cpp | 10 | ||||
-rw-r--r-- | korganizer/koagendaitem.cpp | 6 | ||||
-rw-r--r-- | korganizer/koagendaitem.h | 1 |
3 files changed, 8 insertions, 9 deletions
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp index 9b817bc..01cef35 100644 --- a/korganizer/koagenda.cpp +++ b/korganizer/koagenda.cpp @@ -1892,54 +1892,58 @@ void KOAgenda::computeSizes() mGridSpacingX = (width() - verticalScrollBar()->width()-frameOffset)/mColumns; if (height() > mGridSpacingY * mRows + 1 ) { KOPrefs::instance()->mHourSize = ((height())/mRows)+1; mGridSpacingY = KOPrefs::instance()->mHourSize ; resizeContents( mGridSpacingX * mColumns + 1 , mGridSpacingY * mRows + 1 ); emit resizedSignal(); } else resizeContents( mGridSpacingX * mColumns + 1 , mGridSpacingY * mRows + 1 ); KOAgendaItem *item; int subCellWidth; for ( item=mItems.first(); item != 0; item=mItems.next() ) { subCellWidth = mGridSpacingX / item->subCells(); item->resize(subCellWidth,item->height()); moveChild(item,(KOGlobals::self()->reverseLayout() ? (mColumns - 1 - item->cellX()) * mGridSpacingX : item->cellX() * mGridSpacingX) + item->subCell() * subCellWidth,childY(item)); } } int cw = contentsWidth(); int ch = contentsHeight(); if ( mAllDayMode ) { QPixmap* paintPixAll = KOAgendaItem::paintPixAllday(); - if ( (paintPixAll->width() < cw || paintPixAll->height() < ch) && cw > 0 && ch > 0 ) + if ( (paintPixAll->width() < cw || paintPixAll->height() < ch) && cw > 0 && ch > 0 ) { + //qDebug("paintPixAll->resize "); paintPixAll->resize( cw, ch ); + } } else { QPixmap* paintPix = KOAgendaItem::paintPix(); - if ( paintPix->width() < cw || paintPix->height() < ch ) - KOAgendaItem::resizePixmap( cw , ch ); + if ( paintPix->width() < cw || paintPix->height() < ch ) { + //qDebug("paintPix->resize "); + paintPix->resize( cw , ch ); + } } checkScrollBoundaries(); marcus_bains(); drawContentsToPainter(); viewport()->repaint(false); } void KOAgenda::scrollUp() { scrollBy(0,-mScrollOffset); } void KOAgenda::scrollDown() { scrollBy(0,mScrollOffset); } void KOAgenda::popupAlarm() { if (!mClickedItem) { qDebug("KOAgenda::popupAlarm() called without having a clicked item "); return; diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp index abb29f7..f855b03 100644 --- a/korganizer/koagendaitem.cpp +++ b/korganizer/koagendaitem.cpp @@ -449,69 +449,65 @@ void KOAgendaItem::paintMe( bool selected, QPainter* paint ) align = ( AlignHCenter|BreakAnywhere|WordBreak|AlignTop); #endif } } QRect dr; if ( w + x > parentWidget()->width() ) w = parentWidget()->width()-x; paint->drawText ( x, yy, w, h, align, mDisplayedText, -1, &dr ); //qDebug("%d %d %d %d ", x, yy, w, h ); if ( mIncidence->cancelled() ){ small = ( height() < 20 ); 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 ); -} 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; + int h = QApplication::desktop()->height()/5; mPaintPixA = new QPixmap(w,h); } return mPaintPixA ; } 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(); diff --git a/korganizer/koagendaitem.h b/korganizer/koagendaitem.h index 7103abe..3ed68b0 100644 --- a/korganizer/koagendaitem.h +++ b/korganizer/koagendaitem.h @@ -80,49 +80,48 @@ class KOAgendaItem : public QWidget void setMultiItem(KOAgendaItem *first,KOAgendaItem *next, KOAgendaItem *last); KOAgendaItem *firstMultiItem() { return mFirstMultiItem; } KOAgendaItem *nextMultiItem() { return mNextMultiItem; } KOAgendaItem *lastMultiItem() { return mLastMultiItem; } Incidence *incidence() const { return mIncidence; } QDate itemDate() { return mDate; } /** Update the date of this item's occurence (not in the event) */ void setItemDate(QDate qd); void setText ( const QString & text ) { mDisplayedText = text; } QString text () { return mDisplayedText; } 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 * 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); void dropEvent(QDropEvent *e); void paintEvent ( QPaintEvent * ); void resizeEvent ( QResizeEvent *ev ); private: KOAgendaItemWhatsThis* mKOAgendaItemWhatsThis; bool mAllDay; bool mWhiteText; int mCellX; int mCellXWidth; int mCellYTop,mCellYBottom; |