summaryrefslogtreecommitdiffabout
path: root/korganizer
Side-by-side diff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagendaitem.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp
index cead612..7b29ce7 100644
--- a/korganizer/koagendaitem.cpp
+++ b/korganizer/koagendaitem.cpp
@@ -370,97 +370,100 @@ void KOAgendaItem::paintMe( bool selected, QPainter* paint )
qDrawShadePanel (paint, x, yy, w, h, mColorGroup, selected , 2, 0);
//qDebug("draw rect %d %d %d %d ",x, yy, w, h );
if ( ! small ) {
x += 3; yy += 3;w -= 6; h-= 5;
} else {
x += 2; yy += 1;w -= 4; h-= 4;
if ( nfh < 6.01 ) {
yy -= 2;
h += 4;
}
else
if ( nfh < h -2 )
++yy;
}
int align;
#ifndef DESKTOP_VERSION
align = ( AlignLeft|WordBreak|AlignTop);
#else
align = ( AlignLeft|BreakAnywhere|WordBreak|AlignTop);
#endif
if ( addIcon ) {
if ( ! horLayout ) {
x += AGENDA_ICON_SIZE+3;
w -= (AGENDA_ICON_SIZE+3);
}
else {
yy+= AGENDA_ICON_SIZE+2;
h -=(AGENDA_ICON_SIZE+3);
}
}
int colsum = mBackgroundColor.red() + mBackgroundColor.green() + mBackgroundColor.blue();
if ( colsum < 250 )
paint->setPen ( white);
if ( x < 0 ) {
w = w+x-3;
x = 3;
if ( w > parentWidget()->width() ){
w = parentWidget()->width() - 6;
#ifndef DESKTOP_VERSION
align = ( AlignCenter|WordBreak);
#else
align = ( AlignCenter|BreakAnywhere|WordBreak);
#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() ){
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 )
mPaintPix = new QPixmap(1,1);
return mPaintPix ;
}
QPixmap * KOAgendaItem::paintPixAllday()
{
static QPixmap* mPaintPixA = 0;
if ( ! mPaintPixA )
mPaintPixA = new QPixmap(1,1);
return mPaintPixA ;
}
QPixmap * KOAgendaItem::paintPixSel()
{
static QPixmap* mPaintPixSel = 0;
if ( ! mPaintPixSel )
mPaintPixSel = new QPixmap(1,1);
return mPaintPixSel ;
}
void KOAgendaItem::paintEvent ( QPaintEvent *e )
{
if ( globalFlagBlockAgendaItemPaint )
return;
if ( globalFlagBlockAgenda > 0 && globalFlagBlockAgenda < 5 )
return;
int yy;
if ( mAllDay )
yy = y();
else