summaryrefslogtreecommitdiffabout
path: root/korganizer/koagenda.cpp
authorzautrix <zautrix>2005-08-17 13:06:53 (UTC)
committer zautrix <zautrix>2005-08-17 13:06:53 (UTC)
commit4b66565ed2db51bc636b7b4c12f19f036d9b80f3 (patch) (unidiff)
tree402372be9f52835e15757a51c18cfc46d47c8953 /korganizer/koagenda.cpp
parent31393a99cd2b190e62a7a09a7739a14af83936d1 (diff)
downloadkdepimpi-4b66565ed2db51bc636b7b4c12f19f036d9b80f3.zip
kdepimpi-4b66565ed2db51bc636b7b4c12f19f036d9b80f3.tar.gz
kdepimpi-4b66565ed2db51bc636b7b4c12f19f036d9b80f3.tar.bz2
allday agenda item fix
Diffstat (limited to 'korganizer/koagenda.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagenda.cpp42
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)
959 gridToContents(moveItem->cellX(),moveItem->cellYTop(),x,y); 959 gridToContents(moveItem->cellX(),moveItem->cellYTop(),x,y);
960 moveItem->resize(mGridSpacingX * moveItem->cellWidth(), 960 int diff = moveItem->resizeMe(mGridSpacingX, mGridSpacingX* moveItem->cellWidth(),
961 mGridSpacingY * moveItem->cellHeight()); 961 mGridSpacingY * moveItem->cellHeight());
962 moveItem->raise(); 962 moveItem->raise();
963 moveChild(moveItem,x,y); 963 moveChild(moveItem,x+diff,y);
964 moveItem = moveItem->nextMultiItem(); 964 moveItem = moveItem->nextMultiItem();
@@ -984,7 +984,8 @@ void KOAgenda::performItemAction(QPoint viewportPos)
984 mActionItem->expandLeft(gx - mCurrentCellX); 984 mActionItem->expandLeft(gx - mCurrentCellX);
985 mActionItem->resize(mGridSpacingX * mActionItem->cellWidth(), 985 int diff = mActionItem->resizeMe(mGridSpacingX ,
986 mActionItem->height()); 986 mGridSpacingX * mActionItem->cellWidth(),
987 mActionItem->height());
987 int x,y; 988 int x,y;
988 gridToContents(mActionItem->cellX(),mActionItem->cellYTop(),x,y); 989 gridToContents(mActionItem->cellX(),mActionItem->cellYTop(),x,y);
989 moveChild(mActionItem,x,childY(mActionItem)); 990 moveChild(mActionItem,x+diff,childY(mActionItem));
990 } 991 }
@@ -993,3 +994,3 @@ void KOAgenda::performItemAction(QPoint viewportPos)
993 mActionItem->expandRight(gx - mCurrentCellX); 994 mActionItem->expandRight(gx - mCurrentCellX);
994 mActionItem->resize(mGridSpacingX * mActionItem->cellWidth(), 995 mActionItem->resizeMe(mGridSpacingX, mGridSpacingX * mActionItem->cellWidth(),
995 mActionItem->height()); 996 mActionItem->height());
@@ -1219,4 +1220,5 @@ void KOAgenda::placeSubCells(KOAgendaItem *placeItem)
1219 item->setSubCells(maxSubCells); 1220 item->setSubCells(maxSubCells);
1221 int diff = 0;
1220 if (mAllDayMode) { 1222 if (mAllDayMode) {
1221 item->resize(item->cellWidth() * mGridSpacingX, newSubCellWidth); 1223 diff = item->resizeMe( mGridSpacingX, item->cellWidth() * mGridSpacingX, newSubCellWidth);
1222 } else { 1224 } else {
@@ -1231,3 +1233,3 @@ void KOAgenda::placeSubCells(KOAgendaItem *placeItem)
1231 } 1233 }
1232 moveChild(item,x,y); 1234 moveChild(item,x+diff,y);
1233 // qDebug("moveChild %s %d %d ", item->incidence()->summary().latin1() ,x,y); 1235 // qDebug("moveChild %s %d %d ", item->incidence()->summary().latin1() ,x,y);
@@ -1245,4 +1247,5 @@ void KOAgenda::placeSubCells(KOAgendaItem *placeItem)
1245 item2->setSubCells(maxSubCells); 1247 item2->setSubCells(maxSubCells);
1248 int diff = 0;
1246 if (mAllDayMode) { 1249 if (mAllDayMode) {
1247 item2->resize(item2->cellWidth() * mGridSpacingX, newSubCellWidth); 1250 diff = item2->resizeMe(mGridSpacingX, item2->cellWidth() * mGridSpacingX, newSubCellWidth);
1248 } else { 1251 } else {
@@ -1257,3 +1260,3 @@ void KOAgenda::placeSubCells(KOAgendaItem *placeItem)
1257 } 1260 }
1258 moveChild(item2,x,y); 1261 moveChild(item2,x+diff,y);
1259 //qDebug("setttttt %d %s",maxSubCells, item2->text().latin1() ); 1262 //qDebug("setttttt %d %s",maxSubCells, item2->text().latin1() );
@@ -1266,3 +1269,4 @@ void KOAgenda::placeSubCells(KOAgendaItem *placeItem)
1266 placeItem->setSubCells(1); 1269 placeItem->setSubCells(1);
1267 if (mAllDayMode) placeItem->resize(placeItem->width(),mGridSpacingY); 1270 int diff = 0;
1271 if (mAllDayMode) diff = placeItem->resizeMe( mGridSpacingX, placeItem->width(),mGridSpacingY);
1268 else placeItem->resize(mGridSpacingX,placeItem->height()); 1272 else placeItem->resize(mGridSpacingX,placeItem->height());
@@ -1270,3 +1274,3 @@ void KOAgenda::placeSubCells(KOAgendaItem *placeItem)
1270 gridToContents(placeItem->cellX(),placeItem->cellYTop(),x,y); 1274 gridToContents(placeItem->cellX(),placeItem->cellYTop(),x,y);
1271 moveChild(placeItem,x,y); 1275 moveChild(placeItem,x+diff,y);
1272 } 1276 }
@@ -1397,2 +1401,3 @@ void KOAgenda::finishUpdate()
1397 int newSubCellWidth; 1401 int newSubCellWidth;
1402 int diff = 0;
1398 if (mAllDayMode) newSubCellWidth = mGridSpacingY / item->subCells(); 1403 if (mAllDayMode) newSubCellWidth = mGridSpacingY / item->subCells();
@@ -1401,3 +1406,3 @@ void KOAgenda::finishUpdate()
1401 if (mAllDayMode) { 1406 if (mAllDayMode) {
1402 item->resize(item->cellWidth() * mGridSpacingX, newSubCellWidth); 1407 diff = item->resizeMe(mGridSpacingX, item->cellWidth() * mGridSpacingX, newSubCellWidth);
1403 } else { 1408 } else {
@@ -1412,3 +1417,3 @@ void KOAgenda::finishUpdate()
1412 } 1417 }
1413 moveChild(item,x,y); 1418 moveChild(item,x+diff,y);
1414 } 1419 }
@@ -1838,3 +1843,3 @@ KOAgendaItem *KOAgenda::insertAllDayItem (Incidence *event,QDate qd,int XBegin,i
1838 agendaItem->setCellXWidth(XEnd); 1843 agendaItem->setCellXWidth(XEnd);
1839 agendaItem->resize(mGridSpacingX * agendaItem->cellWidth(),mGridSpacingY); 1844 agendaItem->resizeMe(mGridSpacingX, mGridSpacingX * agendaItem->cellWidth(),mGridSpacingY);
1840 1845
@@ -1944,6 +1949,7 @@ void KOAgenda::computeSizes()
1944 subCellWidth = mGridSpacingY / item->subCells(); 1949 subCellWidth = mGridSpacingY / item->subCells();
1945 item->resize(mGridSpacingX * item->cellWidth(),subCellWidth); 1950 int diff = 0;
1946 moveChild(item,KOGlobals::self()->reverseLayout() ? 1951 diff = item->resizeMe(mGridSpacingX ,mGridSpacingX * item->cellWidth(),subCellWidth);
1952 moveChild(item,(KOGlobals::self()->reverseLayout() ?
1947 (mColumns - 1 - item->cellX()) * mGridSpacingX : 1953 (mColumns - 1 - item->cellX()) * mGridSpacingX :
1948 item->cellX() * mGridSpacingX, 1954 item->cellX() * mGridSpacingX) + diff,
1949 item->subCell() * subCellWidth); 1955 item->subCell() * subCellWidth);