author | zautrix <zautrix> | 2005-02-23 21:53:18 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-23 21:53:18 (UTC) |
commit | 4a9bf75c2ef12a40be3aea1d147f3703aee48638 (patch) (unidiff) | |
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 | |||
@@ -477,12 +477,13 @@ CalendarView::~CalendarView() | |||
477 | //qDebug("CalendarView::~CalendarView() "); | 477 | //qDebug("CalendarView::~CalendarView() "); |
478 | delete mDialogManager; | 478 | delete mDialogManager; |
479 | delete mViewManager; | 479 | delete mViewManager; |
480 | delete mStorage; | 480 | delete mStorage; |
481 | delete mDateFrame ; | 481 | delete mDateFrame ; |
482 | delete beamDialog; | 482 | delete beamDialog; |
483 | delete mEventViewerDialog; | ||
483 | //kdDebug() << "~CalendarView() done" << endl; | 484 | //kdDebug() << "~CalendarView() done" << endl; |
484 | } | 485 | } |
485 | 486 | ||
486 | void CalendarView::showDay( QDate d ) | 487 | void CalendarView::showDay( QDate d ) |
487 | { | 488 | { |
488 | dateNavigator()->blockSignals( true ); | 489 | dateNavigator()->blockSignals( true ); |
@@ -2524,13 +2525,19 @@ void CalendarView::showDatePicker( ) | |||
2524 | mDatePicker->setDate( mNavigator->selectedDates().first() ); | 2525 | mDatePicker->setDate( mNavigator->selectedDates().first() ); |
2525 | } | 2526 | } |
2526 | 2527 | ||
2527 | void CalendarView::showEventEditor() | 2528 | void CalendarView::showEventEditor() |
2528 | { | 2529 | { |
2529 | #ifdef DESKTOP_VERSION | 2530 | #ifdef DESKTOP_VERSION |
2531 | int x,y,w,h; | ||
2532 | x = mEventEditor->geometry().x(); | ||
2533 | y = mEventEditor->geometry().y(); | ||
2534 | w = mEventEditor->width(); | ||
2535 | h = mEventEditor->height(); | ||
2530 | mEventEditor->show(); | 2536 | mEventEditor->show(); |
2537 | mEventEditor->setGeometry(x,y,w,h); | ||
2531 | #else | 2538 | #else |
2532 | if ( mEventEditor->width() < QApplication::desktop()->width() -60 || mEventEditor->width() > QApplication::desktop()->width() ) { | 2539 | if ( mEventEditor->width() < QApplication::desktop()->width() -60 || mEventEditor->width() > QApplication::desktop()->width() ) { |
2533 | topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); | 2540 | topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); |
2534 | qDebug("KO: CalendarView: recreate mEventEditor %d %d", mEventEditor->width(), QApplication::desktop()->width() ); | 2541 | qDebug("KO: CalendarView: recreate mEventEditor %d %d", mEventEditor->width(), QApplication::desktop()->width() ); |
2535 | qApp->processEvents(); | 2542 | qApp->processEvents(); |
2536 | delete mEventEditor; | 2543 | delete mEventEditor; |
@@ -2540,13 +2547,19 @@ void CalendarView::showEventEditor() | |||
2540 | mEventEditor->showMaximized(); | 2547 | mEventEditor->showMaximized(); |
2541 | #endif | 2548 | #endif |
2542 | } | 2549 | } |
2543 | void CalendarView::showTodoEditor() | 2550 | void CalendarView::showTodoEditor() |
2544 | { | 2551 | { |
2545 | #ifdef DESKTOP_VERSION | 2552 | #ifdef DESKTOP_VERSION |
2553 | int x,y,w,h; | ||
2554 | x = mTodoEditor->geometry().x(); | ||
2555 | y = mTodoEditor->geometry().y(); | ||
2556 | w = mTodoEditor->width(); | ||
2557 | h = mTodoEditor->height(); | ||
2546 | mTodoEditor->show(); | 2558 | mTodoEditor->show(); |
2559 | mTodoEditor->setGeometry(x,y,w,h); | ||
2547 | #else | 2560 | #else |
2548 | if ( mTodoEditor->width() < QApplication::desktop()->width() -60|| mTodoEditor->width() > QApplication::desktop()->width() ) { | 2561 | if ( mTodoEditor->width() < QApplication::desktop()->width() -60|| mTodoEditor->width() > QApplication::desktop()->width() ) { |
2549 | topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); | 2562 | topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); |
2550 | qDebug("KO: CalendarView: recreate mTodoEditor %d %d ", mTodoEditor->width() ,QApplication::desktop()->width() ); | 2563 | qDebug("KO: CalendarView: recreate mTodoEditor %d %d ", mTodoEditor->width() ,QApplication::desktop()->width() ); |
2551 | qApp->processEvents(); | 2564 | qApp->processEvents(); |
2552 | delete mTodoEditor; | 2565 | delete mTodoEditor; |
@@ -2790,13 +2803,13 @@ void CalendarView::editTodo( Todo *todo ) | |||
2790 | 2803 | ||
2791 | } | 2804 | } |
2792 | 2805 | ||
2793 | KOEventViewerDialog* CalendarView::getEventViewerDialog() | 2806 | KOEventViewerDialog* CalendarView::getEventViewerDialog() |
2794 | { | 2807 | { |
2795 | if ( !mEventViewerDialog ) { | 2808 | if ( !mEventViewerDialog ) { |
2796 | mEventViewerDialog = new KOEventViewerDialog(this); | 2809 | mEventViewerDialog = new KOEventViewerDialog(0); |
2797 | connect( mEventViewerDialog, SIGNAL( editIncidence( Incidence* )), this, SLOT(editIncidence( Incidence* ) ) ); | 2810 | connect( mEventViewerDialog, SIGNAL( editIncidence( Incidence* )), this, SLOT(editIncidence( Incidence* ) ) ); |
2798 | connect( this, SIGNAL(configChanged()), mEventViewerDialog, SLOT(updateConfig())); | 2811 | connect( this, SIGNAL(configChanged()), mEventViewerDialog, SLOT(updateConfig())); |
2799 | connect( mEventViewerDialog, SIGNAL(jumpToTime( const QDate &)), | 2812 | connect( mEventViewerDialog, SIGNAL(jumpToTime( const QDate &)), |
2800 | dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); | 2813 | dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); |
2801 | connect( mEventViewerDialog, SIGNAL(showAgendaView( bool ) ), | 2814 | connect( mEventViewerDialog, SIGNAL(showAgendaView( bool ) ), |
2802 | viewManager(), SLOT( showAgendaView( bool ) ) ); | 2815 | viewManager(), SLOT( showAgendaView( bool ) ) ); |
@@ -3964,11 +3977,12 @@ void CalendarView::resetFocus() | |||
3964 | } else | 3977 | } else |
3965 | mViewerCallerIsSearchDialog = false; | 3978 | mViewerCallerIsSearchDialog = false; |
3966 | } | 3979 | } |
3967 | if ( !mViewerCallerIsSearchDialog ) { | 3980 | if ( !mViewerCallerIsSearchDialog ) { |
3968 | //mViewManager->currentView()->setFocus(); | 3981 | //mViewManager->currentView()->setFocus(); |
3969 | //qDebug("sssssssssssssssset focus "); | 3982 | //qDebug("sssssssssssssssset focus "); |
3983 | topLevelWidget()->raise(); | ||
3970 | setActiveWindow(); | 3984 | setActiveWindow(); |
3971 | //setFocus(); | 3985 | //setFocus(); |
3972 | } | 3986 | } |
3973 | mViewerCallerIsSearchDialog = false; | 3987 | mViewerCallerIsSearchDialog = false; |
3974 | } | 3988 | } |
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp index 195b1fa..ec81d44 100644 --- a/korganizer/koagenda.cpp +++ b/korganizer/koagenda.cpp | |||
@@ -1178,13 +1178,36 @@ void KOAgenda::drawContents(QPainter* p, int cx, int cy, int cw, int ch) | |||
1178 | } | 1178 | } |
1179 | 1179 | ||
1180 | void KOAgenda::finishUpdate() | 1180 | void KOAgenda::finishUpdate() |
1181 | { | 1181 | { |
1182 | 1182 | ||
1183 | KOAgendaItem *item; | 1183 | KOAgendaItem *item; |
1184 | globalFlagBlockAgendaItemPaint = 1; | 1184 | globalFlagBlockAgendaItemPaint = 1; |
1185 | // 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 | ||
1186 | for ( item=mItems.first(); item != 0; item=mItems.next() ) { | ||
1187 | if ( !item->checkLayout() ) { | ||
1188 | //qDebug(" conflictitem found "); | ||
1189 | int newSubCellWidth; | ||
1190 | if (mAllDayMode) newSubCellWidth = mGridSpacingY / item->subCells(); | ||
1191 | else newSubCellWidth = mGridSpacingX / item->subCells(); | ||
1192 | |||
1193 | if (mAllDayMode) { | ||
1194 | item->resize(item->cellWidth() * mGridSpacingX, newSubCellWidth); | ||
1195 | } else { | ||
1196 | item->resize(newSubCellWidth, item->cellHeight() * mGridSpacingY); | ||
1197 | } | ||
1198 | int x,y; | ||
1199 | gridToContents(item->cellX(),item->cellYTop(),x,y); | ||
1200 | if (mAllDayMode) { | ||
1201 | y += item->subCell() * newSubCellWidth; | ||
1202 | } else { | ||
1203 | x += item->subCell() * newSubCellWidth; | ||
1204 | } | ||
1205 | moveChild(item,x,y); | ||
1206 | } | ||
1207 | } | ||
1185 | for ( item=mItems.first(); item != 0; item=mItems.next() ) { | 1208 | for ( item=mItems.first(); item != 0; item=mItems.next() ) { |
1186 | if ( !item->isVisible() ) | 1209 | if ( !item->isVisible() ) |
1187 | item->show(); | 1210 | item->show(); |
1188 | 1211 | ||
1189 | } | 1212 | } |
1190 | globalFlagBlockAgendaItemUpdate = 0; | 1213 | globalFlagBlockAgendaItemUpdate = 0; |
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp index 38bd93a..042a789 100644 --- a/korganizer/koagendaitem.cpp +++ b/korganizer/koagendaitem.cpp | |||
@@ -761,6 +761,24 @@ void KOAgendaItem::setConflictItems(QPtrList<KOAgendaItem> ci) | |||
761 | 761 | ||
762 | void KOAgendaItem::addConflictItem(KOAgendaItem *ci) | 762 | void KOAgendaItem::addConflictItem(KOAgendaItem *ci) |
763 | { | 763 | { |
764 | if (mConflictItems.find(ci)<0) | 764 | if (mConflictItems.find(ci)<0) |
765 | mConflictItems.append(ci); | 765 | mConflictItems.append(ci); |
766 | } | 766 | } |
767 | |||
768 | bool KOAgendaItem::checkLayout() | ||
769 | { | ||
770 | if ( !mConflictItems.count() ) | ||
771 | return true; | ||
772 | int max = 0; | ||
773 | KOAgendaItem *item; | ||
774 | for ( item=mConflictItems.first(); item != 0; | ||
775 | item=mConflictItems.next() ) { | ||
776 | if ( item->subCells() > max ) | ||
777 | max = item->subCells(); | ||
778 | } | ||
779 | if ( max > subCells() ) { | ||
780 | setSubCells( max ); | ||
781 | return false; | ||
782 | } | ||
783 | return true; | ||
784 | } | ||
diff --git a/korganizer/koagendaitem.h b/korganizer/koagendaitem.h index 5b8f420..b4dba79 100644 --- a/korganizer/koagendaitem.h +++ b/korganizer/koagendaitem.h | |||
@@ -104,12 +104,13 @@ class KOAgendaItem : public QWidget | |||
104 | static QPixmap * paintPix(); | 104 | static QPixmap * paintPix(); |
105 | static QPixmap * paintPixSel(); | 105 | static QPixmap * paintPixSel(); |
106 | static QPixmap * paintPixAllday(); | 106 | static QPixmap * paintPixAllday(); |
107 | void updateItem(); | 107 | void updateItem(); |
108 | void computeText(); | 108 | void computeText(); |
109 | void recreateIncidence(); | 109 | void recreateIncidence(); |
110 | bool checkLayout(); | ||
110 | public slots: | 111 | public slots: |
111 | bool updateIcons( QPainter *, bool ); | 112 | bool updateIcons( QPainter *, bool ); |
112 | void select(bool=true); | 113 | void select(bool=true); |
113 | 114 | ||
114 | protected: | 115 | protected: |
115 | void dragEnterEvent(QDragEnterEvent *e); | 116 | void dragEnterEvent(QDragEnterEvent *e); |
diff --git a/korganizer/koeventviewerdialog.cpp b/korganizer/koeventviewerdialog.cpp index 8bada3b..e2c8e6e 100644 --- a/korganizer/koeventviewerdialog.cpp +++ b/korganizer/koeventviewerdialog.cpp | |||
@@ -71,16 +71,23 @@ KOEventViewerDialog::~KOEventViewerDialog() | |||
71 | //qDebug("-------~KOEventViewerDialog() "); | 71 | //qDebug("-------~KOEventViewerDialog() "); |
72 | } | 72 | } |
73 | void KOEventViewerDialog::showMe() | 73 | void KOEventViewerDialog::showMe() |
74 | { | 74 | { |
75 | 75 | ||
76 | #ifdef DESKTOP_VERSION | 76 | #ifdef DESKTOP_VERSION |
77 | int x,y,w,h; | ||
78 | x = geometry().x(); | ||
79 | y = geometry().y(); | ||
80 | w = width(); | ||
81 | h = height(); | ||
77 | show(); | 82 | show(); |
83 | setGeometry(x,y,w,h); | ||
78 | #else | 84 | #else |
79 | showMaximized(); | 85 | showMaximized(); |
80 | #endif | 86 | #endif |
87 | raise(); | ||
81 | setActiveWindow(); | 88 | setActiveWindow(); |
82 | mEventViewer->setFocus(); | 89 | mEventViewer->setFocus(); |
83 | 90 | ||
84 | } | 91 | } |
85 | void KOEventViewerDialog::setSyncMode( bool b ) | 92 | void KOEventViewerDialog::setSyncMode( bool b ) |
86 | { | 93 | { |
@@ -255,13 +262,15 @@ void KOEventViewerDialog::keyPressEvent ( QKeyEvent * e ) | |||
255 | break; | 262 | break; |
256 | case Qt::Key_C: | 263 | case Qt::Key_C: |
257 | case Qt::Key_Escape: | 264 | case Qt::Key_Escape: |
258 | close(); | 265 | close(); |
259 | break; | 266 | break; |
260 | case Qt::Key_I: | 267 | case Qt::Key_I: |
261 | accept(); | 268 | sendSignalViewerClosed = true; |
269 | slotViewerClosed(); | ||
270 | //accept(); | ||
262 | break; | 271 | break; |
263 | default: | 272 | default: |
264 | KDialogBase::keyPressEvent ( e ); | 273 | KDialogBase::keyPressEvent ( e ); |
265 | break; | 274 | break; |
266 | } | 275 | } |
267 | 276 | ||