-rw-r--r-- | korganizer/koagenda.cpp | 124 |
1 files changed, 57 insertions, 67 deletions
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp index 148d914..18c506e 100644 --- a/korganizer/koagenda.cpp +++ b/korganizer/koagenda.cpp | |||
@@ -1362,85 +1362,75 @@ void KOAgenda::placeSubCells(KOAgendaItem *placeItem) | |||
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 | if ( ! mAllDayMode ) { |
1367 | if ( mCurPixWid != contentsWidth() || mCurPixHei != contentsHeight() ) | 1367 | // currently not working for |
1368 | ;//drawContentsToPainter(); | ||
1369 | 1368 | ||
1370 | QPaintDevice* pd = p->device(); | 1369 | //qDebug("KOAgenda::drawContents "); |
1371 | p->end(); | 1370 | if ( mCurPixWid != contentsWidth() || mCurPixHei != contentsHeight() ) |
1372 | int vx, vy; | 1371 | ;//drawContentsToPainter(); |
1373 | int selectionX = KOGlobals::self()->reverseLayout() ? | 1372 | |
1373 | QPaintDevice* pd = p->device(); | ||
1374 | p->end(); | ||
1375 | int vx, vy; | ||
1376 | int selectionX = KOGlobals::self()->reverseLayout() ? | ||
1374 | (mColumns - 1 - mSelectionCellX) * mGridSpacingX : | 1377 | (mColumns - 1 - mSelectionCellX) * mGridSpacingX : |
1375 | mSelectionCellX * mGridSpacingX; | 1378 | mSelectionCellX * mGridSpacingX; |
1376 | contentsToViewport ( cx, cy, vx,vy); | 1379 | contentsToViewport ( cx, cy, vx,vy); |
1377 | //qDebug(" %d %d %d %d %d", cx, cy, cw,ch,mGridSpacingX-1) ; | 1380 | //qDebug(" %d %d %d %d %d", cx, cy, cw,ch,mGridSpacingX-1) ; |
1378 | 1381 | ||
1379 | if ( !(selectionX == cx && cy == mSelectionYTop && cw ==mGridSpacingX && ch == mSelectionHeight ) ) { | 1382 | if ( !(selectionX == cx && cy == mSelectionYTop && cw ==mGridSpacingX && ch == mSelectionHeight ) ) { |
1380 | if ( mGridSpacingX == cw && mSelectionHeight > 0 && ( ( cx + cw ) >= selectionX && cx <= ( selectionX + mGridSpacingX ) && | 1383 | if ( mGridSpacingX == cw && mSelectionHeight > 0 && ( ( cx + cw ) >= selectionX && cx <= ( selectionX + mGridSpacingX ) && |
1381 | ( cy + ch ) >= mSelectionYTop && cy <= ( mSelectionYTop + mSelectionHeight ) ) ) { | 1384 | ( cy + ch ) >= mSelectionYTop && cy <= ( mSelectionYTop + mSelectionHeight ) ) ) { |
1382 | 1385 | ||
1383 | int vxSel, vySel; | 1386 | int vxSel, vySel; |
1384 | contentsToViewport ( selectionX, mSelectionYTop, vxSel,vySel); | 1387 | contentsToViewport ( selectionX, mSelectionYTop, vxSel,vySel); |
1385 | int off = mSelectionHeight; | 1388 | int off = mSelectionHeight; |
1386 | if ( vySel < 0 ) | 1389 | if ( vySel < 0 ) |
1387 | off += vySel; | 1390 | off += vySel; |
1388 | //qDebug("OFF %d %d %d", off,vySel, vy ); | 1391 | //qDebug("OFF %d %d %d", off,vySel, vy ); |
1389 | bitBlt ( pd, vx, vy+off, &mPaintPixmap, cx, cy+off, cw , ch-off ,CopyROP); | 1392 | bitBlt ( pd, vx, vy+off, &mPaintPixmap, cx, cy+off, cw , ch-off ,CopyROP); |
1390 | } else { | 1393 | } else { |
1391 | bitBlt ( pd, vx, vy, &mPaintPixmap, cx, cy, cw, ch ,CopyROP); | 1394 | bitBlt ( pd, vx, vy, &mPaintPixmap, cx, cy, cw, ch ,CopyROP); |
1395 | } | ||
1392 | } | 1396 | } |
1393 | } | 1397 | if ( mSelectionHeight > 0 ) { |
1394 | if ( mSelectionHeight > 0 ) { | 1398 | //qDebug("---- %d %d %d %d ", selectionX, mSelectionYTop, mGridSpacingX, mSelectionHeight ); |
1395 | //qDebug("---- %d %d %d %d ", selectionX, mSelectionYTop, mGridSpacingX, mSelectionHeight ); | 1399 | if ( ( cx + cw ) >= selectionX && cx <= ( selectionX + mGridSpacingX ) && |
1396 | if ( ( cx + cw ) >= selectionX && cx <= ( selectionX + mGridSpacingX ) && | 1400 | ( cy + ch ) >= mSelectionYTop && cy <= ( mSelectionYTop + mSelectionHeight ) ) { |
1397 | ( cy + ch ) >= mSelectionYTop && cy <= ( mSelectionYTop + mSelectionHeight ) ) { | 1401 | contentsToViewport ( selectionX, mSelectionYTop, vx,vy); |
1398 | contentsToViewport ( selectionX, mSelectionYTop, vx,vy); | 1402 | bitBlt ( pd, vx+1, vy, &mHighlightPixmap, 0, mSelectionYTop, mGridSpacingX-1, mSelectionHeight ,CopyROP); |
1399 | bitBlt ( pd, vx+1, vy, &mHighlightPixmap, 0, mSelectionYTop, mGridSpacingX-1, mSelectionHeight ,CopyROP); | 1403 | } |
1400 | } | 1404 | } |
1401 | } | 1405 | p->begin( pd ); |
1402 | //qDebug("btbl "); | 1406 | } else { |
1403 | p->begin( pd ); | 1407 | |
1404 | //qDebug("end "); | 1408 | if ( mCurPixWid != contentsWidth() || mCurPixHei != contentsHeight() ) |
1405 | #if 0 | 1409 | ;//drawContentsToPainter(); |
1406 | |||
1407 | if ( globalFlagBlockAgenda ) | ||
1408 | return; | ||
1409 | //qDebug("KOAgenda::drawContents "); | ||
1410 | if ( mCurPixWid != contentsWidth() || mCurPixHei != contentsHeight() ) | ||
1411 | ;//drawContentsToPainter(); | ||
1412 | 1410 | ||
1413 | QPaintDevice* pd = p->device(); | 1411 | QPaintDevice* pd = p->device(); |
1414 | p->end(); | 1412 | p->end(); |
1415 | int vx, vy; | 1413 | int vx, vy; |
1416 | int selectionX = KOGlobals::self()->reverseLayout() ? | 1414 | int selectionX = KOGlobals::self()->reverseLayout() ? |
1417 | (mColumns - 1 - mSelectionCellX) * mGridSpacingX : | 1415 | (mColumns - 1 - mSelectionCellX) * mGridSpacingX : |
1418 | mSelectionCellX * mGridSpacingX; | 1416 | mSelectionCellX * mGridSpacingX; |
1419 | contentsToViewport ( cx, cy, vx,vy); | 1417 | contentsToViewport ( cx, cy, vx,vy); |
1420 | // qDebug(" %d %d %d %d ", cx, cy, cw,ch) ; | 1418 | // qDebug(" %d %d %d %d ", cx, cy, cw,ch) ; |
1421 | if ( !(selectionX == cx && cy == mSelectionYTop && cw ==mGridSpacingX && ch == mSelectionHeight ) ) | 1419 | if ( !(selectionX == cx && cy == mSelectionYTop && cw ==mGridSpacingX && ch == mSelectionHeight ) ) |
1422 | bitBlt ( pd, vx, vy, &mPaintPixmap, cx, cy, cw, ch ,CopyROP); | 1420 | bitBlt ( pd, vx, vy, &mPaintPixmap, cx, cy, cw, ch ,CopyROP); |
1423 | 1421 | ||
1424 | if ( mSelectionHeight > 0 ) { | 1422 | if ( mSelectionHeight > 0 ) { |
1425 | //qDebug("---- %d %d %d %d ", selectionX, mSelectionYTop, mGridSpacingX, mSelectionHeight ); | 1423 | //qDebug("---- %d %d %d %d ", selectionX, mSelectionYTop, mGridSpacingX, mSelectionHeight ); |
1426 | if ( ( cx + cw ) >= selectionX && cx <= ( selectionX + mGridSpacingX ) && | 1424 | if ( ( cx + cw ) >= selectionX && cx <= ( selectionX + mGridSpacingX ) && |
1427 | ( cy + ch ) >= mSelectionYTop && cy <= ( mSelectionYTop + mSelectionHeight ) ) { | 1425 | ( cy + ch ) >= mSelectionYTop && cy <= ( mSelectionYTop + mSelectionHeight ) ) { |
1428 | contentsToViewport ( selectionX, mSelectionYTop, vx,vy); | 1426 | contentsToViewport ( selectionX, mSelectionYTop, vx,vy); |
1429 | bitBlt ( pd, vx+1, vy, &mHighlightPixmap, 0, mSelectionYTop, mGridSpacingX-1, mSelectionHeight ,CopyROP); | 1427 | bitBlt ( pd, vx+1, vy, &mHighlightPixmap, 0, mSelectionYTop, mGridSpacingX-1, mSelectionHeight ,CopyROP); |
1430 | } | 1428 | } |
1431 | } | 1429 | } |
1432 | //qDebug("btbl "); | 1430 | p->begin( pd ); |
1433 | p->begin( pd ); | 1431 | } |
1434 | //qDebug("end "); | ||
1435 | |||
1436 | |||
1437 | |||
1438 | |||
1439 | |||
1440 | |||
1441 | 1432 | ||
1442 | #endif | ||
1443 | } | 1433 | } |
1444 | 1434 | ||
1445 | void KOAgenda::finishUpdate() | 1435 | void KOAgenda::finishUpdate() |
1446 | { | 1436 | { |
@@ -1966,9 +1956,9 @@ void KOAgenda::finishResize ( ) | |||
1966 | Overridden from QScrollView to provide proper resizing of KOAgendaItems. | 1956 | Overridden from QScrollView to provide proper resizing of KOAgendaItems. |
1967 | */ | 1957 | */ |
1968 | void KOAgenda::resizeEvent ( QResizeEvent *ev ) | 1958 | void KOAgenda::resizeEvent ( QResizeEvent *ev ) |
1969 | { | 1959 | { |
1970 | 1960 | mSelectionHeight = 0; | |
1971 | mResizeTimer.start( 150 , true ); | 1961 | mResizeTimer.start( 150 , true ); |
1972 | computeSizes(); | 1962 | computeSizes(); |
1973 | return; | 1963 | return; |
1974 | 1964 | ||