author | zautrix <zautrix> | 2005-02-23 21:53:18 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-23 21:53:18 (UTC) |
commit | 4a9bf75c2ef12a40be3aea1d147f3703aee48638 (patch) (side-by-side diff) | |
tree | 62b2e4d0b63487ff2818c18f8bc1a3233df46e76 | |
parent | 31f24d21cd23bb7e4033e7ffa000e6c979133ce7 (diff) | |
download | kdepimpi-4a9bf75c2ef12a40be3aea1d147f3703aee48638.zip kdepimpi-4a9bf75c2ef12a40be3aea1d147f3703aee48638.tar.gz kdepimpi-4a9bf75c2ef12a40be3aea1d147f3703aee48638.tar.bz2 |
morelayout fixes
-rw-r--r-- | korganizer/calendarview.cpp | 16 | ||||
-rw-r--r-- | korganizer/koagenda.cpp | 25 | ||||
-rw-r--r-- | korganizer/koagendaitem.cpp | 18 | ||||
-rw-r--r-- | korganizer/koagendaitem.h | 1 | ||||
-rw-r--r-- | korganizer/koeventviewerdialog.cpp | 11 |
5 files changed, 68 insertions, 3 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 1009956..d6918d3 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -482,2 +482,3 @@ CalendarView::~CalendarView() delete beamDialog; + delete mEventViewerDialog; //kdDebug() << "~CalendarView() done" << endl; @@ -2529,3 +2530,9 @@ void CalendarView::showEventEditor() #ifdef DESKTOP_VERSION + int x,y,w,h; + x = mEventEditor->geometry().x(); + y = mEventEditor->geometry().y(); + w = mEventEditor->width(); + h = mEventEditor->height(); mEventEditor->show(); + mEventEditor->setGeometry(x,y,w,h); #else @@ -2545,3 +2552,9 @@ void CalendarView::showTodoEditor() #ifdef DESKTOP_VERSION + int x,y,w,h; + x = mTodoEditor->geometry().x(); + y = mTodoEditor->geometry().y(); + w = mTodoEditor->width(); + h = mTodoEditor->height(); mTodoEditor->show(); + mTodoEditor->setGeometry(x,y,w,h); #else @@ -2795,3 +2808,3 @@ KOEventViewerDialog* CalendarView::getEventViewerDialog() if ( !mEventViewerDialog ) { - mEventViewerDialog = new KOEventViewerDialog(this); + mEventViewerDialog = new KOEventViewerDialog(0); connect( mEventViewerDialog, SIGNAL( editIncidence( Incidence* )), this, SLOT(editIncidence( Incidence* ) ) ); @@ -3969,2 +3982,3 @@ void CalendarView::resetFocus() //qDebug("sssssssssssssssset focus "); + topLevelWidget()->raise(); setActiveWindow(); diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp index 195b1fa..ec81d44 100644 --- a/korganizer/koagenda.cpp +++ b/korganizer/koagenda.cpp @@ -1183,3 +1183,26 @@ void KOAgenda::finishUpdate() KOAgendaItem *item; - globalFlagBlockAgendaItemPaint = 1; + globalFlagBlockAgendaItemPaint = 1; + // Adjust sub cell geometry of all conflict items of all conflict items of all conflict items ... of the conflict item with the max number of conflictitems + for ( item=mItems.first(); item != 0; item=mItems.next() ) { + if ( !item->checkLayout() ) { + //qDebug(" conflictitem found "); + int newSubCellWidth; + if (mAllDayMode) newSubCellWidth = mGridSpacingY / item->subCells(); + else newSubCellWidth = mGridSpacingX / item->subCells(); + + 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); + } + } for ( item=mItems.first(); item != 0; item=mItems.next() ) { diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp index 38bd93a..042a789 100644 --- a/korganizer/koagendaitem.cpp +++ b/korganizer/koagendaitem.cpp @@ -766 +766,19 @@ void KOAgendaItem::addConflictItem(KOAgendaItem *ci) } + +bool KOAgendaItem::checkLayout() +{ + if ( !mConflictItems.count() ) + return true; + int max = 0; + KOAgendaItem *item; + for ( item=mConflictItems.first(); item != 0; + item=mConflictItems.next() ) { + if ( item->subCells() > max ) + max = item->subCells(); + } + if ( max > subCells() ) { + setSubCells( max ); + return false; + } + return true; +} diff --git a/korganizer/koagendaitem.h b/korganizer/koagendaitem.h index 5b8f420..b4dba79 100644 --- a/korganizer/koagendaitem.h +++ b/korganizer/koagendaitem.h @@ -109,2 +109,3 @@ class KOAgendaItem : public QWidget void recreateIncidence(); + bool checkLayout(); public slots: diff --git a/korganizer/koeventviewerdialog.cpp b/korganizer/koeventviewerdialog.cpp index 8bada3b..e2c8e6e 100644 --- a/korganizer/koeventviewerdialog.cpp +++ b/korganizer/koeventviewerdialog.cpp @@ -76,3 +76,9 @@ void KOEventViewerDialog::showMe() #ifdef DESKTOP_VERSION + int x,y,w,h; + x = geometry().x(); + y = geometry().y(); + w = width(); + h = height(); show(); + setGeometry(x,y,w,h); #else @@ -80,2 +86,3 @@ void KOEventViewerDialog::showMe() #endif + raise(); setActiveWindow(); @@ -260,3 +267,5 @@ void KOEventViewerDialog::keyPressEvent ( QKeyEvent * e ) case Qt::Key_I: - accept(); + sendSignalViewerClosed = true; + slotViewerClosed(); + //accept(); break; |