author | zautrix <zautrix> | 2005-02-23 10:58:09 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-23 10:58:09 (UTC) |
commit | 36704cb63582c161d2ab5c63e66ee63bbf3b865f (patch) (unidiff) | |
tree | 1541d63b50f7bc50278c6fed164f4b5228f18362 /korganizer | |
parent | 87a2f1a301beae2a8550c340348741c69f0ac1dd (diff) | |
download | kdepimpi-36704cb63582c161d2ab5c63e66ee63bbf3b865f.zip kdepimpi-36704cb63582c161d2ab5c63e66ee63bbf3b865f.tar.gz kdepimpi-36704cb63582c161d2ab5c63e66ee63bbf3b865f.tar.bz2 |
fixed layout problem
-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) | |||
1076 | int newSubCellWidth; | 1076 | int newSubCellWidth; |
1077 | if (mAllDayMode) newSubCellWidth = mGridSpacingY / maxSubCells; | 1077 | if (mAllDayMode) newSubCellWidth = mGridSpacingY / maxSubCells; |
1078 | else newSubCellWidth = mGridSpacingX / maxSubCells; | 1078 | else newSubCellWidth = mGridSpacingX / maxSubCells; |
1079 | conflictItems.append(placeItem); | 1079 | conflictItems.append(placeItem); |
1080 | 1080 | ||
1081 | 1081 | ||
1082 | // Adjust sub cell geometry of all items | 1082 | // Adjust sub cell geometry of all direct conflict items |
1083 | for ( item=conflictItems.first(); item != 0; | 1083 | for ( item=conflictItems.first(); item != 0; |
1084 | item=conflictItems.next() ) { | 1084 | item=conflictItems.next() ) { |
1085 | item->setSubCells(maxSubCells); | 1085 | item->setSubCells(maxSubCells); |
1086 | if (mAllDayMode) { | 1086 | if (mAllDayMode) { |
1087 | item->resize(item->cellWidth() * mGridSpacingX, newSubCellWidth); | 1087 | item->resize(item->cellWidth() * mGridSpacingX, newSubCellWidth); |
1088 | } else { | 1088 | } else { |
@@ -1096,13 +1096,40 @@ void KOAgenda::placeSubCells(KOAgendaItem *placeItem) | |||
1096 | x += item->subCell() * newSubCellWidth; | 1096 | x += item->subCell() * newSubCellWidth; |
1097 | } | 1097 | } |
1098 | moveChild(item,x,y); | 1098 | moveChild(item,x,y); |
1099 | // qDebug("moveChild %s %d %d ", item->incidence()->summary().latin1() ,x,y); | 1099 | // qDebug("moveChild %s %d %d ", item->incidence()->summary().latin1() ,x,y); |
1100 | //item->updateItem(); | 1100 | //item->updateItem(); |
1101 | } | 1101 | } |
1102 | 1102 | // Adjust sub cell geometry of all conflict items of all conflict items | |
1103 | for ( item=conflictItems.first(); item != 0; | ||
1104 | item=conflictItems.next() ) { | ||
1105 | if ( placeItem != item ) { | ||
1106 | KOAgendaItem *item2; | ||
1107 | QPtrList<KOAgendaItem> conflictItems2 = item->conflictItems(); | ||
1108 | for ( item2=conflictItems2.first(); item2 != 0; | ||
1109 | item2=conflictItems2.next() ) { | ||
1110 | if ( item2->subCells() != maxSubCells) { | ||
1111 | item2->setSubCells(maxSubCells); | ||
1112 | if (mAllDayMode) { | ||
1113 | item2->resize(item2->cellWidth() * mGridSpacingX, newSubCellWidth); | ||
1114 | } else { | ||
1115 | item2->resize(newSubCellWidth, item2->cellHeight() * mGridSpacingY); | ||
1116 | } | ||
1117 | int x,y; | ||
1118 | gridToContents(item2->cellX(),item2->cellYTop(),x,y); | ||
1119 | if (mAllDayMode) { | ||
1120 | y += item2->subCell() * newSubCellWidth; | ||
1121 | } else { | ||
1122 | x += item2->subCell() * newSubCellWidth; | ||
1123 | } | ||
1124 | moveChild(item2,x,y); | ||
1125 | //qDebug("setttttt %d %s",maxSubCells, item2->text().latin1() ); | ||
1126 | } | ||
1127 | } | ||
1128 | } | ||
1129 | } | ||
1103 | } else { | 1130 | } else { |
1104 | placeItem->setSubCell(0); | 1131 | placeItem->setSubCell(0); |
1105 | placeItem->setSubCells(1); | 1132 | placeItem->setSubCells(1); |
1106 | if (mAllDayMode) placeItem->resize(placeItem->width(),mGridSpacingY); | 1133 | if (mAllDayMode) placeItem->resize(placeItem->width(),mGridSpacingY); |
1107 | else placeItem->resize(mGridSpacingX,placeItem->height()); | 1134 | else placeItem->resize(mGridSpacingX,placeItem->height()); |
1108 | int x,y; | 1135 | 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 ) | |||
132 | } | 132 | } |
133 | mColorGroup = QColorGroup( mBackgroundColor.light(), | 133 | mColorGroup = QColorGroup( mBackgroundColor.light(), |
134 | mBackgroundColor.dark(),mBackgroundColor.light(), | 134 | mBackgroundColor.dark(),mBackgroundColor.light(), |
135 | mBackgroundColor.dark(),mBackgroundColor, black, mBackgroundColor) ; | 135 | mBackgroundColor.dark(),mBackgroundColor, black, mBackgroundColor) ; |
136 | setBackgroundColor( mBackgroundColor ); | 136 | setBackgroundColor( mBackgroundColor ); |
137 | 137 | ||
138 | mConflictItems.clear(); | ||
138 | setCellXY(0,0,1); | 139 | setCellXY(0,0,1); |
139 | setCellXWidth(0); | 140 | setCellXWidth(0); |
140 | setSubCell(0); | 141 | setSubCell(0); |
141 | setSubCells(1); | 142 | setSubCells(1); |
142 | setMultiItem(0,0,0); | 143 | setMultiItem(0,0,0); |
143 | startMove(); | 144 | startMove(); |