-rw-r--r-- | korganizer/koagenda.cpp | 31 | ||||
-rw-r--r-- | korganizer/koagendaitem.cpp | 1 |
2 files changed, 30 insertions, 2 deletions
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp index a72e470..195b1fa 100644 --- a/korganizer/koagenda.cpp +++ b/korganizer/koagenda.cpp @@ -1076,13 +1076,13 @@ void KOAgenda::placeSubCells(KOAgendaItem *placeItem) int newSubCellWidth; if (mAllDayMode) newSubCellWidth = mGridSpacingY / maxSubCells; else newSubCellWidth = mGridSpacingX / maxSubCells; conflictItems.append(placeItem); - // Adjust sub cell geometry of all items + // Adjust sub cell geometry of all direct conflict items for ( item=conflictItems.first(); item != 0; item=conflictItems.next() ) { item->setSubCells(maxSubCells); if (mAllDayMode) { item->resize(item->cellWidth() * mGridSpacingX, newSubCellWidth); } else { @@ -1096,13 +1096,40 @@ void KOAgenda::placeSubCells(KOAgendaItem *placeItem) x += item->subCell() * newSubCellWidth; } moveChild(item,x,y); // qDebug("moveChild %s %d %d ", item->incidence()->summary().latin1() ,x,y); //item->updateItem(); } - + // Adjust sub cell geometry of all conflict items of all conflict items + for ( item=conflictItems.first(); item != 0; + item=conflictItems.next() ) { + if ( placeItem != item ) { + KOAgendaItem *item2; + QPtrList<KOAgendaItem> conflictItems2 = item->conflictItems(); + for ( item2=conflictItems2.first(); item2 != 0; + item2=conflictItems2.next() ) { + if ( item2->subCells() != maxSubCells) { + item2->setSubCells(maxSubCells); + if (mAllDayMode) { + item2->resize(item2->cellWidth() * mGridSpacingX, newSubCellWidth); + } else { + item2->resize(newSubCellWidth, item2->cellHeight() * mGridSpacingY); + } + int x,y; + gridToContents(item2->cellX(),item2->cellYTop(),x,y); + if (mAllDayMode) { + y += item2->subCell() * newSubCellWidth; + } else { + x += item2->subCell() * newSubCellWidth; + } + moveChild(item2,x,y); + //qDebug("setttttt %d %s",maxSubCells, item2->text().latin1() ); + } + } + } + } } else { placeItem->setSubCell(0); placeItem->setSubCells(1); if (mAllDayMode) placeItem->resize(placeItem->width(),mGridSpacingY); else placeItem->resize(mGridSpacingX,placeItem->height()); int x,y; diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp index d0a7b07..38bd93a 100644 --- a/korganizer/koagendaitem.cpp +++ b/korganizer/koagendaitem.cpp @@ -132,12 +132,13 @@ void KOAgendaItem::init ( Incidence *incidence, QDate qd ) } mColorGroup = QColorGroup( mBackgroundColor.light(), mBackgroundColor.dark(),mBackgroundColor.light(), mBackgroundColor.dark(),mBackgroundColor, black, mBackgroundColor) ; setBackgroundColor( mBackgroundColor ); + mConflictItems.clear(); setCellXY(0,0,1); setCellXWidth(0); setSubCell(0); setSubCells(1); setMultiItem(0,0,0); startMove(); |