summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore 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
@@ -1275,17 +1275,26 @@ void KOAgenda::drawContents(QPainter* p, int cx, int cy, int cw, int ch)
1275 bitBlt ( pd, vx, vy, &mPaintPixmap, cx, cy, cw, ch ,CopyROP); 1275 bitBlt ( pd, vx, vy, &mPaintPixmap, cx, cy, cw, ch ,CopyROP);
1276 } 1276 }
1277 } 1277 }
1278 if ( mSelectionHeight > 0 ) { 1278 if ( mSelectionHeight > 0 ) {
1279 //qDebug("---- %d %d %d %d ", selectionX, mSelectionYTop, mGridSpacingX, mSelectionHeight ); 1279 //qDebug("---- %d %d %d %d ", selectionX, mSelectionYTop, mGridSpacingX, mSelectionHeight );
1280 if ( ( cx + cw ) >= selectionX && cx <= ( selectionX + mGridSpacingX ) && 1280 if ( ( cx + cw ) >= selectionX && cx <= ( selectionX + mGridSpacingX ) &&
1281 ( cy + ch ) >= mSelectionYTop && cy <= ( mSelectionYTop + mSelectionHeight ) ) { 1281 ( cy + ch ) >= mSelectionYTop && cy <= ( mSelectionYTop + mSelectionHeight ) ) {
1282 contentsToViewport ( selectionX, mSelectionYTop, vx,vy); 1282 contentsToViewport ( selectionX, mSelectionYTop, vx,vy);
1283 bitBlt ( pd, vx+1, vy, &mHighlightPixmap, 0, mSelectionYTop, mGridSpacingX-1, mSelectionHeight ,CopyROP); 1283 // bitBlt ( pd, vx+1, vy, &mHighlightPixmap, 0, mSelectionYTop, mGridSpacingX-1, mSelectionHeight ,CopyROP);
1284 int hei = mSelectionHeight;
1285 int offset = 0;
1286 while ( hei > 0 ) {
1287 int p_hei = 5;
1288 if ( hei < 5 ) p_hei = hei;
1289 hei -= 5;
1290 bitBlt ( pd, vx+1, vy+offset, &mHighlightPixmap, 0, 0, mGridSpacingX-1, p_hei ,CopyROP);
1291 offset += 5;
1292 }
1284 } 1293 }
1285 } 1294 }
1286 p->begin( pd ); 1295 p->begin( pd );
1287 } else { 1296 } else {
1288 1297
1289 if ( mCurPixWid != contentsWidth() || mCurPixHei != contentsHeight() ) 1298 if ( mCurPixWid != contentsWidth() || mCurPixHei != contentsHeight() )
1290 ;//drawContentsToPainter(); 1299 ;//drawContentsToPainter();
1291 1300
@@ -1300,17 +1309,26 @@ void KOAgenda::drawContents(QPainter* p, int cx, int cy, int cw, int ch)
1300 if ( !(selectionX == cx && cy == mSelectionYTop && cw ==mGridSpacingX && ch == mSelectionHeight ) ) 1309 if ( !(selectionX == cx && cy == mSelectionYTop && cw ==mGridSpacingX && ch == mSelectionHeight ) )
1301 bitBlt ( pd, vx, vy, &mPaintPixmap, cx, cy, cw, ch ,CopyROP); 1310 bitBlt ( pd, vx, vy, &mPaintPixmap, cx, cy, cw, ch ,CopyROP);
1302 1311
1303 if ( mSelectionHeight > 0 ) { 1312 if ( mSelectionHeight > 0 ) {
1304 //qDebug("---- %d %d %d %d ", selectionX, mSelectionYTop, mGridSpacingX, mSelectionHeight ); 1313 //qDebug("---- %d %d %d %d ", selectionX, mSelectionYTop, mGridSpacingX, mSelectionHeight );
1305 if ( ( cx + cw ) >= selectionX && cx <= ( selectionX + mGridSpacingX ) && 1314 if ( ( cx + cw ) >= selectionX && cx <= ( selectionX + mGridSpacingX ) &&
1306 ( cy + ch ) >= mSelectionYTop && cy <= ( mSelectionYTop + mSelectionHeight ) ) { 1315 ( cy + ch ) >= mSelectionYTop && cy <= ( mSelectionYTop + mSelectionHeight ) ) {
1307 contentsToViewport ( selectionX, mSelectionYTop, vx,vy); 1316 contentsToViewport ( selectionX, mSelectionYTop, vx,vy);
1308 bitBlt ( pd, vx+1, vy, &mHighlightPixmap, 0, mSelectionYTop, mGridSpacingX-1, mSelectionHeight ,CopyROP); 1317 //bitBlt ( pd, vx+1, vy, &mHighlightPixmap, 0, mSelectionYTop, mGridSpacingX-1, mSelectionHeight ,CopyROP);
1318 int hei = mSelectionHeight;
1319 int offset = 0;
1320 while ( hei > 0 ) {
1321 int p_hei = 5;
1322 if ( hei < 5 ) p_hei = hei;
1323 hei -= 5;
1324 bitBlt ( pd, vx+1, vy+offset, &mHighlightPixmap, 0, 0, mGridSpacingX-1, p_hei ,CopyROP);
1325 offset += 5;
1326 }
1309 } 1327 }
1310 } 1328 }
1311 p->begin( pd ); 1329 p->begin( pd );
1312 } 1330 }
1313 1331
1314} 1332}
1315 1333
1316void KOAgenda::finishUpdate() 1334void KOAgenda::finishUpdate()
@@ -1373,18 +1391,18 @@ void KOAgenda::drawContentsToPainter( QPainter* paint, bool backgroundOnly )// i
1373 int cx = 0, cy = 0, cw = contentsWidth(), ch = contentsHeight(); 1391 int cx = 0, cy = 0, cw = contentsWidth(), ch = contentsHeight();
1374 if ( ch < 1 ) 1392 if ( ch < 1 )
1375 ch = 1; 1393 ch = 1;
1376 if ( mPaintPixmap.width() < contentsWidth()+42 || mPaintPixmap.height() < ch ) { 1394 if ( mPaintPixmap.width() < contentsWidth()+42 || mPaintPixmap.height() < ch ) {
1377 mPaintPixmap.resize( contentsWidth()+42, ch ); 1395 mPaintPixmap.resize( contentsWidth()+42, ch );
1378 } 1396 }
1379 mCurPixWid = contentsWidth(); 1397 mCurPixWid = contentsWidth();
1380 mCurPixHei = ch; 1398 mCurPixHei = ch;
1381 if ( mHighlightPixmap.width() < mGridSpacingX-1 || mHighlightPixmap.height() < ch ) { 1399 if ( mHighlightPixmap.width() < mGridSpacingX-1 ) {
1382 mHighlightPixmap.resize( mGridSpacingX-1, ch ); 1400 mHighlightPixmap.resize( mGridSpacingX-1, 5 );
1383 mHighlightPixmap.fill ( KOPrefs::instance()->mHighlightColor ); 1401 mHighlightPixmap.fill ( KOPrefs::instance()->mHighlightColor );
1384 } 1402 }
1385 mPixPainter.begin( &mPaintPixmap) ; 1403 mPixPainter.begin( &mPaintPixmap) ;
1386 //qDebug("wid %d hei %d ",mPaintPixmap.width(),mPaintPixmap.height() ); 1404 //qDebug("wid %d hei %d ",mPaintPixmap.width(),mPaintPixmap.height() );
1387 QPainter * p ; 1405 QPainter * p ;
1388 if (paint == 0) { 1406 if (paint == 0) {
1389 mPaintPixmap.fill(KOPrefs::instance()->mAgendaBgColor); 1407 mPaintPixmap.fill(KOPrefs::instance()->mAgendaBgColor);
1390 p = &mPixPainter; 1408 p = &mPixPainter;