summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--korganizer/koagenda.cpp26
1 files changed, 22 insertions, 4 deletions
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp
index 94c3b22..63fdecd 100644
--- a/korganizer/koagenda.cpp
+++ b/korganizer/koagenda.cpp
@@ -1259,74 +1259,92 @@ void KOAgenda::drawContents(QPainter* p, int cx, int cy, int cw, int ch)
mSelectionCellX * mGridSpacingX;
contentsToViewport ( cx, cy, vx,vy);
//qDebug(" %d %d %d %d %d", cx, cy, cw,ch,mGridSpacingX-1) ;
if ( !(selectionX == cx && cy == mSelectionYTop && cw ==mGridSpacingX && ch == mSelectionHeight ) ) {
if ( mGridSpacingX == cw && mSelectionHeight > 0 && ( ( cx + cw ) >= selectionX && cx <= ( selectionX + mGridSpacingX ) &&
( cy + ch ) >= mSelectionYTop && cy <= ( mSelectionYTop + mSelectionHeight ) ) ) {
int vxSel, vySel;
contentsToViewport ( selectionX, mSelectionYTop, vxSel,vySel);
int off = mSelectionHeight;
if ( vySel < 0 )
off += vySel;
//qDebug("OFF %d %d %d", off,vySel, vy );
bitBlt ( pd, vx, vy+off, &mPaintPixmap, cx, cy+off, cw , ch-off ,CopyROP);
} else {
bitBlt ( pd, vx, vy, &mPaintPixmap, cx, cy, cw, ch ,CopyROP);
}
}
if ( mSelectionHeight > 0 ) {
//qDebug("---- %d %d %d %d ", selectionX, mSelectionYTop, mGridSpacingX, mSelectionHeight );
if ( ( cx + cw ) >= selectionX && cx <= ( selectionX + mGridSpacingX ) &&
( cy + ch ) >= mSelectionYTop && cy <= ( mSelectionYTop + mSelectionHeight ) ) {
contentsToViewport ( selectionX, mSelectionYTop, vx,vy);
- bitBlt ( pd, vx+1, vy, &mHighlightPixmap, 0, mSelectionYTop, mGridSpacingX-1, mSelectionHeight ,CopyROP);
+ // bitBlt ( pd, vx+1, vy, &mHighlightPixmap, 0, mSelectionYTop, mGridSpacingX-1, mSelectionHeight ,CopyROP);
+ int hei = mSelectionHeight;
+ int offset = 0;
+ while ( hei > 0 ) {
+ int p_hei = 5;
+ if ( hei < 5 ) p_hei = hei;
+ hei -= 5;
+ bitBlt ( pd, vx+1, vy+offset, &mHighlightPixmap, 0, 0, mGridSpacingX-1, p_hei ,CopyROP);
+ offset += 5;
+ }
}
}
p->begin( pd );
} else {
if ( mCurPixWid != contentsWidth() || mCurPixHei != contentsHeight() )
;//drawContentsToPainter();
QPaintDevice* pd = p->device();
p->end();
int vx, vy;
int selectionX = KOGlobals::self()->reverseLayout() ?
(mColumns - 1 - mSelectionCellX) * mGridSpacingX :
mSelectionCellX * mGridSpacingX;
contentsToViewport ( cx, cy, vx,vy);
// qDebug(" %d %d %d %d ", cx, cy, cw,ch) ;
if ( !(selectionX == cx && cy == mSelectionYTop && cw ==mGridSpacingX && ch == mSelectionHeight ) )
bitBlt ( pd, vx, vy, &mPaintPixmap, cx, cy, cw, ch ,CopyROP);
if ( mSelectionHeight > 0 ) {
//qDebug("---- %d %d %d %d ", selectionX, mSelectionYTop, mGridSpacingX, mSelectionHeight );
if ( ( cx + cw ) >= selectionX && cx <= ( selectionX + mGridSpacingX ) &&
( cy + ch ) >= mSelectionYTop && cy <= ( mSelectionYTop + mSelectionHeight ) ) {
contentsToViewport ( selectionX, mSelectionYTop, vx,vy);
- bitBlt ( pd, vx+1, vy, &mHighlightPixmap, 0, mSelectionYTop, mGridSpacingX-1, mSelectionHeight ,CopyROP);
+ //bitBlt ( pd, vx+1, vy, &mHighlightPixmap, 0, mSelectionYTop, mGridSpacingX-1, mSelectionHeight ,CopyROP);
+ int hei = mSelectionHeight;
+ int offset = 0;
+ while ( hei > 0 ) {
+ int p_hei = 5;
+ if ( hei < 5 ) p_hei = hei;
+ hei -= 5;
+ bitBlt ( pd, vx+1, vy+offset, &mHighlightPixmap, 0, 0, mGridSpacingX-1, p_hei ,CopyROP);
+ offset += 5;
+ }
}
}
p->begin( pd );
}
}
void KOAgenda::finishUpdate()
{
KOAgendaItem *item;
globalFlagBlockAgendaItemPaint = 1;
// Adjust sub cell geometry of all conflict items of all conflict items of all conflict items ... of the conflict item with the max number of conflictitems
for ( item=mItems.first(); item != 0; item=mItems.next() ) {
if ( !item->checkLayout() ) {
//qDebug(" conflictitem found ");
int newSubCellWidth;
if (mAllDayMode) newSubCellWidth = mGridSpacingY / item->subCells();
else newSubCellWidth = mGridSpacingX / item->subCells();
if (mAllDayMode) {
item->resize(item->cellWidth() * mGridSpacingX, newSubCellWidth);
} else {
item->resize(newSubCellWidth, item->cellHeight() * mGridSpacingY);
@@ -1357,50 +1375,50 @@ void KOAgenda::finishUpdate()
item->repaint( false );
}
}
/*
Draw grid in the background of the agenda.
*/
void KOAgenda::drawContentsToPainter( QPainter* paint, bool backgroundOnly )// int cx, int cy, int cw, int ch)
{
if ( ! mGridSpacingX || ! mGridSpacingY ||! mHolidayMask )
return;
if ( globalFlagBlockAgenda > 1 && globalFlagBlockAgenda < 4 )
return;
int cx = 0, cy = 0, cw = contentsWidth(), ch = contentsHeight();
if ( ch < 1 )
ch = 1;
if ( mPaintPixmap.width() < contentsWidth()+42 || mPaintPixmap.height() < ch ) {
mPaintPixmap.resize( contentsWidth()+42, ch );
}
mCurPixWid = contentsWidth();
mCurPixHei = ch;
- if ( mHighlightPixmap.width() < mGridSpacingX-1 || mHighlightPixmap.height() < ch ) {
- mHighlightPixmap.resize( mGridSpacingX-1, ch );
+ if ( mHighlightPixmap.width() < mGridSpacingX-1 ) {
+ mHighlightPixmap.resize( mGridSpacingX-1, 5 );
mHighlightPixmap.fill ( KOPrefs::instance()->mHighlightColor );
}
mPixPainter.begin( &mPaintPixmap) ;
//qDebug("wid %d hei %d ",mPaintPixmap.width(),mPaintPixmap.height() );
QPainter * p ;
if (paint == 0) {
mPaintPixmap.fill(KOPrefs::instance()->mAgendaBgColor);
p = &mPixPainter;
}
else
p = paint ;
// qDebug("++++++KOAgenda::drawContentsTo Painter %d %d %d %d ", cx, cy, cw, ch);
//--cx;++cw;
int lGridSpacingY = mGridSpacingY*2;
int selDay;
if ( !backgroundOnly )
for ( selDay = 0; selDay < mSelectedDates.count(); ++selDay)
{
if ( mSelectedDates[selDay] == QDateTime::currentDateTime ().date() && KOPrefs::instance()->mHighlightCurrentDay) {
int x1 = cx;
int y1 = 0;
if (y1 < cy) y1 = cy;
int x2 = cx+cw-1;