-rw-r--r-- | bin/kdepim/WhatsNew.txt | 1 | ||||
-rw-r--r-- | korganizer/koagenda.cpp | 31 | ||||
-rw-r--r-- | korganizer/koagendaitem.cpp | 1 |
3 files changed, 31 insertions, 2 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index 05c1afd..28029ee 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt @@ -1,29 +1,30 @@ Info about the changes in new versions of KDE-Pim/Pi ********** VERSION 2.0.12 ************ Fixed a bug in todo start/due date handling for non recurring todos with a start and due date. +Fixed some layout problems in the KO/Pi agenda view when there were many conflicting itmes. ********** VERSION 2.0.11 ************ Fixed some problems in pi-sync mode (e.g. details of events were not synced properly) ********** VERSION 2.0.10 ************ KO/Pi: In the desktop versions the context menu in the search dialog was broken after introducing the What'sThis info for the list view. This is fixed. Changed the search dialog a bit to make it more user friendly. (E.g.: Removed message box about "no items found" and set key focus to search line edit after search). Added config option to hide the week number in KO/Pi toolbar. ********** VERSION 2.0.9 ************ Made month view icons for multiday events a bit nicer. Some minor fixes in KO/Pi (e.g. go to today did not work for new week view properly). diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp index a72e470..195b1fa 100644 --- a/korganizer/koagenda.cpp +++ b/korganizer/koagenda.cpp @@ -1058,69 +1058,96 @@ void KOAgenda::placeSubCells(KOAgendaItem *placeItem) } } if (conflictItems.count() > 0) { // Look for unused sub cell and insert item int i; for(i=0;i<maxSubCells;++i) { if (!subCellDict.find(i)) { placeItem->setSubCell(i); break; } } if (i == maxSubCells) { placeItem->setSubCell(maxSubCells); maxSubCells++; // add new item to number of sub cells } // Prepare for sub cell geometry adjustment 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 { item->resize(newSubCellWidth, item->cellHeight() * mGridSpacingY); } int x,y; gridToContents(item->cellX(),item->cellYTop(),x,y); if (mAllDayMode) { y += item->subCell() * newSubCellWidth; } else { 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; gridToContents(placeItem->cellX(),placeItem->cellYTop(),x,y); moveChild(placeItem,x,y); } placeItem->setConflictItems(conflictItems); // for ( item=conflictItems.first(); item != 0; // item=conflictItems.next() ) { // //item->updateItem(); // //qDebug("xxx item->updateItem() %s %d %d", item->incidence()->summary().latin1(),item->x(), item->y() ); // } // placeItem->updateItem(); } void KOAgenda::drawContents(QPainter* p, int cx, int cy, int cw, int ch) { if ( globalFlagBlockAgenda ) return; //qDebug("KOAgenda::drawContents "); if ( mCurPixWid != contentsWidth() || mCurPixHei != contentsHeight() ) diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp index d0a7b07..38bd93a 100644 --- a/korganizer/koagendaitem.cpp +++ b/korganizer/koagendaitem.cpp @@ -114,48 +114,49 @@ void KOAgendaItem::init ( Incidence *incidence, QDate qd ) mBackgroundColor = KOPrefs::instance()->mTodoDueTodayColor; } else { QStringList categories = mIncidence->categories(); QString cat = categories.first(); if (cat.isEmpty()) { if ( (incidence->type() == "Todo") &&((static_cast<Todo*>(incidence))->isCompleted()) ) mBackgroundColor =KOPrefs::instance()->mTodoDoneColor; else mBackgroundColor =KOPrefs::instance()->mEventColor; } else { mBackgroundColor = *KOPrefs::instance()->categoryColor(cat); if ( (incidence->type() == "Todo") &&((static_cast<Todo*>(incidence))->isCompleted()) ) { if ( mBackgroundColor == KOPrefs::instance()->mEventColor ) mBackgroundColor =KOPrefs::instance()->mTodoDoneColor; } } } 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(); mSelected = true; select(false); QFontMetrics fontinf(KOPrefs::instance()->mAgendaViewFont); mFontPixelSize = fontinf.height();; hide(); xPaintCoord = -1; yPaintCoord = -1; } KOAgendaItem::~KOAgendaItem() { // qDebug("deleteKOAgendaItem::~KOAgendaItem( "); } void KOAgendaItem::recreateIncidence() { |