summaryrefslogtreecommitdiffabout
path: root/korganizer/koagendaitem.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/koagendaitem.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagendaitem.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp
index df7d612..6a312b3 100644
--- a/korganizer/koagendaitem.cpp
+++ b/korganizer/koagendaitem.cpp
@@ -272,97 +272,97 @@ void KOAgendaItem::select(bool selected)
}
}
globalFlagBlockAgendaItemUpdate = 0;
paintMe( selected );
globalFlagBlockAgendaItemUpdate = 1;
repaint( false );
}
/*
The eventFilter has to filter the mouse events of the agenda item childs. The
events are fed into the event handling method of KOAgendaItem. This allows the
KOAgenda to handle the KOAgendaItems by using an eventFilter.
*/
bool KOAgendaItem::eventFilter ( QObject *object, QEvent *e )
{
if (e->type() == QEvent::MouseButtonPress ||
e->type() == QEvent::MouseButtonDblClick ||
e->type() == QEvent::MouseButtonRelease ||
e->type() == QEvent::MouseMove) {
QMouseEvent *me = (QMouseEvent *)e;
QPoint itemPos = this->mapFromGlobal(((QWidget *)object)->
mapToGlobal(me->pos()));
QMouseEvent returnEvent (e->type(),itemPos,me->button(),me->state());
return event(&returnEvent);
} else {
return false;
}
}
void KOAgendaItem::repaintMe( )
{
paintMe ( mSelected );
}
void KOAgendaItem::paintMe( bool selected, QPainter* paint )
{
if ( globalFlagBlockAgendaItemUpdate && ! selected)
return;
QPainter pa;
if ( mSelected ) {
pa.begin( paintPixSel() );
} else {
if ( mAllDay )
pa.begin( paintPixAllday() );
else
pa.begin( paintPix() );
}
int x, yy, w, h;
- float nfh;
+ float nfh = 7.0;
x = pos().x(); w = width(); h = height ();
if ( mAllDay )
yy = y();
else
yy = mCellYTop * ( height() / cellHeight() );
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 );
if ( ! small )
paint->setFont(KOPrefs::instance()->mAgendaViewFont);
else {
QFont f = KOPrefs::instance()->mAgendaViewFont;
f.setBold( false );
int fh = f.pointSize();
nfh = (((float)height())/(float)(mFontPixelSize+4))*fh;
if ( nfh < 6 )
nfh = 6;
f.setPointSize( nfh );
paint->setFont(f);
}
paint->fillRect ( x, yy, w, h, mBackgroundColor );
static const QPixmap completedPxmp = SmallIcon("greenhook16");
static const QPixmap overduePxmp = SmallIcon("redcross16");
if ( mIncidence->type() == "Todo" ) {
Todo* tempTodo = static_cast<Todo*>(mIncidence);
int xx = pos().x()+(width()-completedPxmp.width()-3 );
int yyy = yy+3;
if ( tempTodo->isCompleted() )
paint->drawPixmap ( xx, yyy, completedPxmp );
else {
paint->drawPixmap ( xx, yyy, overduePxmp );
}
}
bool addIcon = false;
if ( ! small || w > 3 * h || h > 3* w )
addIcon = updateIcons( paint, horLayout );
qDrawShadePanel (paint, x, yy, w, h, mColorGroup, selected , 2, 0);