-rw-r--r-- | korganizer/koagenda.cpp | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp index 88f5d99..796d633 100644 --- a/korganizer/koagenda.cpp +++ b/korganizer/koagenda.cpp @@ -959,6 +959,6 @@ void KOAgenda::performItemAction(QPoint viewportPos) gridToContents(moveItem->cellX(),moveItem->cellYTop(),x,y); - moveItem->resize(mGridSpacingX * moveItem->cellWidth(), + int diff = moveItem->resizeMe(mGridSpacingX, mGridSpacingX* moveItem->cellWidth(), mGridSpacingY * moveItem->cellHeight()); moveItem->raise(); - moveChild(moveItem,x,y); + moveChild(moveItem,x+diff,y); moveItem = moveItem->nextMultiItem(); @@ -984,7 +984,8 @@ void KOAgenda::performItemAction(QPoint viewportPos) mActionItem->expandLeft(gx - mCurrentCellX); - mActionItem->resize(mGridSpacingX * mActionItem->cellWidth(), - mActionItem->height()); + int diff = mActionItem->resizeMe(mGridSpacingX , + mGridSpacingX * mActionItem->cellWidth(), + mActionItem->height()); int x,y; gridToContents(mActionItem->cellX(),mActionItem->cellYTop(),x,y); - moveChild(mActionItem,x,childY(mActionItem)); + moveChild(mActionItem,x+diff,childY(mActionItem)); } @@ -993,3 +994,3 @@ void KOAgenda::performItemAction(QPoint viewportPos) mActionItem->expandRight(gx - mCurrentCellX); - mActionItem->resize(mGridSpacingX * mActionItem->cellWidth(), + mActionItem->resizeMe(mGridSpacingX, mGridSpacingX * mActionItem->cellWidth(), mActionItem->height()); @@ -1219,4 +1220,5 @@ void KOAgenda::placeSubCells(KOAgendaItem *placeItem) item->setSubCells(maxSubCells); + int diff = 0; if (mAllDayMode) { - item->resize(item->cellWidth() * mGridSpacingX, newSubCellWidth); + diff = item->resizeMe( mGridSpacingX, item->cellWidth() * mGridSpacingX, newSubCellWidth); } else { @@ -1231,3 +1233,3 @@ void KOAgenda::placeSubCells(KOAgendaItem *placeItem) } - moveChild(item,x,y); + moveChild(item,x+diff,y); // qDebug("moveChild %s %d %d ", item->incidence()->summary().latin1() ,x,y); @@ -1245,4 +1247,5 @@ void KOAgenda::placeSubCells(KOAgendaItem *placeItem) item2->setSubCells(maxSubCells); + int diff = 0; if (mAllDayMode) { - item2->resize(item2->cellWidth() * mGridSpacingX, newSubCellWidth); + diff = item2->resizeMe(mGridSpacingX, item2->cellWidth() * mGridSpacingX, newSubCellWidth); } else { @@ -1257,3 +1260,3 @@ void KOAgenda::placeSubCells(KOAgendaItem *placeItem) } - moveChild(item2,x,y); + moveChild(item2,x+diff,y); //qDebug("setttttt %d %s",maxSubCells, item2->text().latin1() ); @@ -1266,3 +1269,4 @@ void KOAgenda::placeSubCells(KOAgendaItem *placeItem) placeItem->setSubCells(1); - if (mAllDayMode) placeItem->resize(placeItem->width(),mGridSpacingY); + int diff = 0; + if (mAllDayMode) diff = placeItem->resizeMe( mGridSpacingX, placeItem->width(),mGridSpacingY); else placeItem->resize(mGridSpacingX,placeItem->height()); @@ -1270,3 +1274,3 @@ void KOAgenda::placeSubCells(KOAgendaItem *placeItem) gridToContents(placeItem->cellX(),placeItem->cellYTop(),x,y); - moveChild(placeItem,x,y); + moveChild(placeItem,x+diff,y); } @@ -1397,2 +1401,3 @@ void KOAgenda::finishUpdate() int newSubCellWidth; + int diff = 0; if (mAllDayMode) newSubCellWidth = mGridSpacingY / item->subCells(); @@ -1401,3 +1406,3 @@ void KOAgenda::finishUpdate() if (mAllDayMode) { - item->resize(item->cellWidth() * mGridSpacingX, newSubCellWidth); + diff = item->resizeMe(mGridSpacingX, item->cellWidth() * mGridSpacingX, newSubCellWidth); } else { @@ -1412,3 +1417,3 @@ void KOAgenda::finishUpdate() } - moveChild(item,x,y); + moveChild(item,x+diff,y); } @@ -1838,3 +1843,3 @@ KOAgendaItem *KOAgenda::insertAllDayItem (Incidence *event,QDate qd,int XBegin,i agendaItem->setCellXWidth(XEnd); - agendaItem->resize(mGridSpacingX * agendaItem->cellWidth(),mGridSpacingY); + agendaItem->resizeMe(mGridSpacingX, mGridSpacingX * agendaItem->cellWidth(),mGridSpacingY); @@ -1944,6 +1949,7 @@ void KOAgenda::computeSizes() subCellWidth = mGridSpacingY / item->subCells(); - item->resize(mGridSpacingX * item->cellWidth(),subCellWidth); - moveChild(item,KOGlobals::self()->reverseLayout() ? + int diff = 0; + diff = item->resizeMe(mGridSpacingX ,mGridSpacingX * item->cellWidth(),subCellWidth); + moveChild(item,(KOGlobals::self()->reverseLayout() ? (mColumns - 1 - item->cellX()) * mGridSpacingX : - item->cellX() * mGridSpacingX, + item->cellX() * mGridSpacingX) + diff, item->subCell() * subCellWidth); |