author | zautrix <zautrix> | 2005-04-09 15:18:54 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-04-09 15:18:54 (UTC) |
commit | 329ecb2c6b4153c51415513a28f2dc0576f4ddca (patch) (unidiff) | |
tree | f96a8be84d1386c5d10a9d18cf2c59c8727046b2 /korganizer | |
parent | 16546abfab89df8dcf3168eaa7c0c346b8e400b4 (diff) | |
download | kdepimpi-329ecb2c6b4153c51415513a28f2dc0576f4ddca.zip kdepimpi-329ecb2c6b4153c51415513a28f2dc0576f4ddca.tar.gz kdepimpi-329ecb2c6b4153c51415513a28f2dc0576f4ddca.tar.bz2 |
agenda fix
-rw-r--r-- | korganizer/koagenda.cpp | 51 |
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 | |||
@@ -1361,47 +1361,98 @@ void KOAgenda::placeSubCells(KOAgendaItem *placeItem) | |||
1361 | 1361 | ||
1362 | void KOAgenda::drawContents(QPainter* p, int cx, int cy, int cw, int ch) | 1362 | void KOAgenda::drawContents(QPainter* p, int cx, int cy, int cw, int ch) |
1363 | { | 1363 | { |
1364 | if ( globalFlagBlockAgenda ) | 1364 | if ( globalFlagBlockAgenda ) |
1365 | return; | 1365 | return; |
1366 | //qDebug("KOAgenda::drawContents "); | 1366 | //qDebug("KOAgenda::drawContents "); |
1367 | if ( mCurPixWid != contentsWidth() || mCurPixHei != contentsHeight() ) | 1367 | if ( mCurPixWid != contentsWidth() || mCurPixHei != contentsHeight() ) |
1368 | ;//drawContentsToPainter(); | 1368 | ;//drawContentsToPainter(); |
1369 | 1369 | ||
1370 | QPaintDevice* pd = p->device(); | 1370 | QPaintDevice* pd = p->device(); |
1371 | p->end(); | 1371 | p->end(); |
1372 | int vx, vy; | 1372 | int vx, vy; |
1373 | int selectionX = KOGlobals::self()->reverseLayout() ? | 1373 | int selectionX = KOGlobals::self()->reverseLayout() ? |
1374 | (mColumns - 1 - mSelectionCellX) * mGridSpacingX : | 1374 | (mColumns - 1 - mSelectionCellX) * mGridSpacingX : |
1375 | mSelectionCellX * mGridSpacingX; | 1375 | mSelectionCellX * mGridSpacingX; |
1376 | contentsToViewport ( cx, cy, vx,vy); | 1376 | contentsToViewport ( cx, cy, vx,vy); |
1377 | //qDebug(" %d %d %d %d %d", cx, cy, cw,ch,mGridSpacingX-1) ; | ||
1378 | |||
1379 | if ( !(selectionX == cx && cy == mSelectionYTop && cw ==mGridSpacingX && ch == mSelectionHeight ) ) { | ||
1380 | if ( mGridSpacingX == cw && mSelectionHeight > 0 && ( ( cx + cw ) >= selectionX && cx <= ( selectionX + mGridSpacingX ) && | ||
1381 | ( cy + ch ) >= mSelectionYTop && cy <= ( mSelectionYTop + mSelectionHeight ) ) ) { | ||
1382 | |||
1383 | int vxSel, vySel; | ||
1384 | contentsToViewport ( selectionX, mSelectionYTop, vxSel,vySel); | ||
1385 | int off = mSelectionHeight; | ||
1386 | if ( vySel < 0 ) | ||
1387 | off += vySel; | ||
1388 | //qDebug("OFF %d %d %d", off,vySel, vy ); | ||
1389 | bitBlt ( pd, vx, vy+off, &mPaintPixmap, cx, cy+off, cw , ch-off ,CopyROP); | ||
1390 | } else { | ||
1391 | bitBlt ( pd, vx, vy, &mPaintPixmap, cx, cy, cw, ch ,CopyROP); | ||
1392 | } | ||
1393 | } | ||
1394 | if ( mSelectionHeight > 0 ) { | ||
1395 | //qDebug("---- %d %d %d %d ", selectionX, mSelectionYTop, mGridSpacingX, mSelectionHeight ); | ||
1396 | if ( ( cx + cw ) >= selectionX && cx <= ( selectionX + mGridSpacingX ) && | ||
1397 | ( cy + ch ) >= mSelectionYTop && cy <= ( mSelectionYTop + mSelectionHeight ) ) { | ||
1398 | contentsToViewport ( selectionX, mSelectionYTop, vx,vy); | ||
1399 | bitBlt ( pd, vx+1, vy, &mHighlightPixmap, 0, mSelectionYTop, mGridSpacingX-1, mSelectionHeight ,CopyROP); | ||
1400 | } | ||
1401 | } | ||
1402 | //qDebug("btbl "); | ||
1403 | p->begin( pd ); | ||
1404 | //qDebug("end "); | ||
1405 | #if 0 | ||
1406 | |||
1407 | if ( globalFlagBlockAgenda ) | ||
1408 | return; | ||
1409 | //qDebug("KOAgenda::drawContents "); | ||
1410 | if ( mCurPixWid != contentsWidth() || mCurPixHei != contentsHeight() ) | ||
1411 | ;//drawContentsToPainter(); | ||
1412 | |||
1413 | QPaintDevice* pd = p->device(); | ||
1414 | p->end(); | ||
1415 | int vx, vy; | ||
1416 | int selectionX = KOGlobals::self()->reverseLayout() ? | ||
1417 | (mColumns - 1 - mSelectionCellX) * mGridSpacingX : | ||
1418 | mSelectionCellX * mGridSpacingX; | ||
1419 | contentsToViewport ( cx, cy, vx,vy); | ||
1377 | // qDebug(" %d %d %d %d ", cx, cy, cw,ch) ; | 1420 | // qDebug(" %d %d %d %d ", cx, cy, cw,ch) ; |
1378 | if ( !(selectionX == cx && cy == mSelectionYTop && cw ==mGridSpacingX && ch == mSelectionHeight ) ) | 1421 | if ( !(selectionX == cx && cy == mSelectionYTop && cw ==mGridSpacingX && ch == mSelectionHeight ) ) |
1379 | bitBlt ( pd, vx, vy, &mPaintPixmap, cx, cy, cw, ch ,CopyROP); | 1422 | bitBlt ( pd, vx, vy, &mPaintPixmap, cx, cy, cw, ch ,CopyROP); |
1380 | 1423 | ||
1381 | if ( mSelectionHeight > 0 ) { | 1424 | if ( mSelectionHeight > 0 ) { |
1382 | //qDebug("---- %d %d %d %d ", selectionX, mSelectionYTop, mGridSpacingX, mSelectionHeight ); | 1425 | //qDebug("---- %d %d %d %d ", selectionX, mSelectionYTop, mGridSpacingX, mSelectionHeight ); |
1383 | if ( ( cx + cw ) >= selectionX && cx <= ( selectionX + mGridSpacingX ) && | 1426 | if ( ( cx + cw ) >= selectionX && cx <= ( selectionX + mGridSpacingX ) && |
1384 | ( cy + ch ) >= mSelectionYTop && cy <= ( mSelectionYTop + mSelectionHeight ) ) { | 1427 | ( cy + ch ) >= mSelectionYTop && cy <= ( mSelectionYTop + mSelectionHeight ) ) { |
1385 | contentsToViewport ( selectionX, mSelectionYTop, vx,vy); | 1428 | contentsToViewport ( selectionX, mSelectionYTop, vx,vy); |
1386 | bitBlt ( pd, vx+1, vy, &mHighlightPixmap, 0, mSelectionYTop, mGridSpacingX-1, mSelectionHeight ,CopyROP); | 1429 | bitBlt ( pd, vx+1, vy, &mHighlightPixmap, 0, mSelectionYTop, mGridSpacingX-1, mSelectionHeight ,CopyROP); |
1387 | } | 1430 | } |
1388 | } | 1431 | } |
1389 | //qDebug("btbl "); | 1432 | //qDebug("btbl "); |
1390 | p->begin( pd ); | 1433 | p->begin( pd ); |
1391 | //qDebug("end "); | 1434 | //qDebug("end "); |
1435 | |||
1436 | |||
1437 | |||
1438 | |||
1439 | |||
1440 | |||
1441 | |||
1442 | #endif | ||
1392 | } | 1443 | } |
1393 | 1444 | ||
1394 | void KOAgenda::finishUpdate() | 1445 | void KOAgenda::finishUpdate() |
1395 | { | 1446 | { |
1396 | 1447 | ||
1397 | KOAgendaItem *item; | 1448 | KOAgendaItem *item; |
1398 | globalFlagBlockAgendaItemPaint = 1; | 1449 | globalFlagBlockAgendaItemPaint = 1; |
1399 | // 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 | 1450 | // 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 |
1400 | for ( item=mItems.first(); item != 0; item=mItems.next() ) { | 1451 | for ( item=mItems.first(); item != 0; item=mItems.next() ) { |
1401 | if ( !item->checkLayout() ) { | 1452 | if ( !item->checkLayout() ) { |
1402 | //qDebug(" conflictitem found "); | 1453 | //qDebug(" conflictitem found "); |
1403 | int newSubCellWidth; | 1454 | int newSubCellWidth; |
1404 | if (mAllDayMode) newSubCellWidth = mGridSpacingY / item->subCells(); | 1455 | if (mAllDayMode) newSubCellWidth = mGridSpacingY / item->subCells(); |
1405 | else newSubCellWidth = mGridSpacingX / item->subCells(); | 1456 | else newSubCellWidth = mGridSpacingX / item->subCells(); |
1406 | 1457 | ||
1407 | if (mAllDayMode) { | 1458 | if (mAllDayMode) { |