summaryrefslogtreecommitdiffabout
path: root/korganizer
Side-by-side diff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagenda.cpp42
-rw-r--r--korganizer/koagendaitem.cpp20
-rw-r--r--korganizer/koagendaitem.h1
3 files changed, 44 insertions, 19 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);
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp
index 49ad9b8..7a685d8 100644
--- a/korganizer/koagendaitem.cpp
+++ b/korganizer/koagendaitem.cpp
@@ -658,3 +658,21 @@ int KOAgendaItem::cellHeight()
}
-
+// it may be that allday agenda items have a needed width > 32000
+// this code is to fix this problem
+int KOAgendaItem::resizeMe( int grid, int wid, int hei )
+{
+ int diff = 0;
+ if ( mCellX < -3 && mAllDay ) {
+ diff = (mCellX + 3) * -grid;
+ //qDebug("%s: cellX %d diff %d wid %d grid %d ", mDisplayedText.latin1(), mCellX, diff, wid, grid);
+ if ( diff >= wid ) {
+ // qDebug("KOAgendaItem::resizeMe: diff >= wid: diff %d wid %d ", diff, wid);
+ //diff = 0;
+ }
+ }
+ if ( wid == width() || diff >= wid )
+ resize( wid, hei );
+ else
+ resize( wid - diff, hei );
+ return diff;
+}
/*
diff --git a/korganizer/koagendaitem.h b/korganizer/koagendaitem.h
index 2b26e95..97acd4c 100644
--- a/korganizer/koagendaitem.h
+++ b/korganizer/koagendaitem.h
@@ -111,2 +111,3 @@ class KOAgendaItem : public QWidget
bool isAllDay() { return mAllDay; }
+ int resizeMe( int grid, int wid, int hei );
public slots: