summaryrefslogtreecommitdiffabout
path: root/korganizer/koagenda.cpp
authorzautrix <zautrix>2005-04-09 15:18:54 (UTC)
committer zautrix <zautrix>2005-04-09 15:18:54 (UTC)
commit329ecb2c6b4153c51415513a28f2dc0576f4ddca (patch) (side-by-side diff)
treef96a8be84d1386c5d10a9d18cf2c59c8727046b2 /korganizer/koagenda.cpp
parent16546abfab89df8dcf3168eaa7c0c346b8e400b4 (diff)
downloadkdepimpi-329ecb2c6b4153c51415513a28f2dc0576f4ddca.zip
kdepimpi-329ecb2c6b4153c51415513a28f2dc0576f4ddca.tar.gz
kdepimpi-329ecb2c6b4153c51415513a28f2dc0576f4ddca.tar.bz2
agenda fix
Diffstat (limited to 'korganizer/koagenda.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagenda.cpp51
1 files changed, 51 insertions, 0 deletions
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp
index b5d52d2..148d914 100644
--- a/korganizer/koagenda.cpp
+++ b/korganizer/koagenda.cpp
@@ -1353,63 +1353,114 @@ void KOAgenda::placeSubCells(KOAgendaItem *placeItem)
placeItem->setConflictItems(conflictItems);
// for ( item=conflictItems.first(); item != 0;
// item=conflictItems.next() ) {
// //item->updateItem();
// //qDebug("xxx item->updateItem() %s %d %d", item->incidence()->summary().latin1(),item->x(), item->y() );
// }
// placeItem->updateItem();
}
void KOAgenda::drawContents(QPainter* p, int cx, int cy, int cw, int ch)
{
if ( globalFlagBlockAgenda )
return;
//qDebug("KOAgenda::drawContents ");
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 %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);
+ }
+ }
+ //qDebug("btbl ");
+ p->begin( pd );
+ //qDebug("end ");
+#if 0
+
+ if ( globalFlagBlockAgenda )
+ return;
+ //qDebug("KOAgenda::drawContents ");
+ 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);
}
}
//qDebug("btbl ");
p->begin( pd );
//qDebug("end ");
+
+
+
+
+
+
+
+#endif
}
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);
}
int x,y;
gridToContents(item->cellX(),item->cellYTop(),x,y);
if (mAllDayMode) {
y += item->subCell() * newSubCellWidth;