summaryrefslogtreecommitdiffabout
path: root/korganizer/koagenda.cpp
Unidiff
Diffstat (limited to 'korganizer/koagenda.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/koagenda.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp
index 195b1fa..ec81d44 100644
--- a/korganizer/koagenda.cpp
+++ b/korganizer/koagenda.cpp
@@ -1161,48 +1161,71 @@ void KOAgenda::drawContents(QPainter* p, int cx, int cy, int cw, int ch)
1161 mSelectionCellX * mGridSpacingX; 1161 mSelectionCellX * mGridSpacingX;
1162 contentsToViewport ( cx, cy, vx,vy); 1162 contentsToViewport ( cx, cy, vx,vy);
1163 // qDebug(" %d %d %d %d ", cx, cy, cw,ch) ; 1163 // qDebug(" %d %d %d %d ", cx, cy, cw,ch) ;
1164 if ( !(selectionX == cx && cy == mSelectionYTop && cw ==mGridSpacingX && ch == mSelectionHeight ) ) 1164 if ( !(selectionX == cx && cy == mSelectionYTop && cw ==mGridSpacingX && ch == mSelectionHeight ) )
1165 bitBlt ( pd, vx, vy, &mPaintPixmap, cx, cy, cw, ch ,CopyROP); 1165 bitBlt ( pd, vx, vy, &mPaintPixmap, cx, cy, cw, ch ,CopyROP);
1166 1166
1167 if ( mSelectionHeight > 0 ) { 1167 if ( mSelectionHeight > 0 ) {
1168 //qDebug("---- %d %d %d %d ", selectionX, mSelectionYTop, mGridSpacingX, mSelectionHeight ); 1168 //qDebug("---- %d %d %d %d ", selectionX, mSelectionYTop, mGridSpacingX, mSelectionHeight );
1169 if ( ( cx + cw ) >= selectionX && cx <= ( selectionX + mGridSpacingX ) && 1169 if ( ( cx + cw ) >= selectionX && cx <= ( selectionX + mGridSpacingX ) &&
1170 ( cy + ch ) >= mSelectionYTop && cy <= ( mSelectionYTop + mSelectionHeight ) ) { 1170 ( cy + ch ) >= mSelectionYTop && cy <= ( mSelectionYTop + mSelectionHeight ) ) {
1171 contentsToViewport ( selectionX, mSelectionYTop, vx,vy); 1171 contentsToViewport ( selectionX, mSelectionYTop, vx,vy);
1172 bitBlt ( pd, vx+1, vy, &mHighlightPixmap, 0, mSelectionYTop, mGridSpacingX-1, mSelectionHeight ,CopyROP); 1172 bitBlt ( pd, vx+1, vy, &mHighlightPixmap, 0, mSelectionYTop, mGridSpacingX-1, mSelectionHeight ,CopyROP);
1173 } 1173 }
1174 } 1174 }
1175 //qDebug("btbl "); 1175 //qDebug("btbl ");
1176 p->begin( pd ); 1176 p->begin( pd );
1177 //qDebug("end "); 1177 //qDebug("end ");
1178} 1178}
1179 1179
1180void KOAgenda::finishUpdate() 1180void KOAgenda::finishUpdate()
1181{ 1181{
1182 1182
1183 KOAgendaItem *item; 1183 KOAgendaItem *item;
1184 globalFlagBlockAgendaItemPaint = 1; 1184 globalFlagBlockAgendaItemPaint = 1;
1185 // 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
1186 for ( item=mItems.first(); item != 0; item=mItems.next() ) {
1187 if ( !item->checkLayout() ) {
1188 //qDebug(" conflictitem found ");
1189 int newSubCellWidth;
1190 if (mAllDayMode) newSubCellWidth = mGridSpacingY / item->subCells();
1191 else newSubCellWidth = mGridSpacingX / item->subCells();
1192
1193 if (mAllDayMode) {
1194 item->resize(item->cellWidth() * mGridSpacingX, newSubCellWidth);
1195 } else {
1196 item->resize(newSubCellWidth, item->cellHeight() * mGridSpacingY);
1197 }
1198 int x,y;
1199 gridToContents(item->cellX(),item->cellYTop(),x,y);
1200 if (mAllDayMode) {
1201 y += item->subCell() * newSubCellWidth;
1202 } else {
1203 x += item->subCell() * newSubCellWidth;
1204 }
1205 moveChild(item,x,y);
1206 }
1207 }
1185 for ( item=mItems.first(); item != 0; item=mItems.next() ) { 1208 for ( item=mItems.first(); item != 0; item=mItems.next() ) {
1186 if ( !item->isVisible() ) 1209 if ( !item->isVisible() )
1187 item->show(); 1210 item->show();
1188 1211
1189 } 1212 }
1190 globalFlagBlockAgendaItemUpdate = 0; 1213 globalFlagBlockAgendaItemUpdate = 0;
1191 for ( item=mItems.first(); item != 0; item=mItems.next() ) { 1214 for ( item=mItems.first(); item != 0; item=mItems.next() ) {
1192 item->repaintMe( ); 1215 item->repaintMe( );
1193 } 1216 }
1194 globalFlagBlockAgendaItemUpdate = 1; 1217 globalFlagBlockAgendaItemUpdate = 1;
1195 qApp->processEvents(); 1218 qApp->processEvents();
1196 globalFlagBlockAgendaItemPaint = 0; 1219 globalFlagBlockAgendaItemPaint = 0;
1197 for ( item=mItems.first(); item != 0; item=mItems.next() ) { 1220 for ( item=mItems.first(); item != 0; item=mItems.next() ) {
1198 item->repaint( false ); 1221 item->repaint( false );
1199 } 1222 }
1200 1223
1201} 1224}
1202 1225
1203/* 1226/*
1204 Draw grid in the background of the agenda. 1227 Draw grid in the background of the agenda.
1205*/ 1228*/
1206void KOAgenda::drawContentsToPainter( QPainter* paint, bool backgroundOnly )// int cx, int cy, int cw, int ch) 1229void KOAgenda::drawContentsToPainter( QPainter* paint, bool backgroundOnly )// int cx, int cy, int cw, int ch)
1207{ 1230{
1208 1231