-rw-r--r-- | korganizer/calendarview.cpp | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 0fbaa9a..a9de65a 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -2460,17 +2460,7 @@ void CalendarView::beamDone( Ir *ir ) void CalendarView::moveIncidence(Incidence * inc ) { if ( !inc ) return; - // qDebug("showDatePickerForIncidence( ) "); - if ( mDateFrame->isVisible() ) - mDateFrame->hide(); - else { - int w =mDatePicker->sizeHint().width()+2*mDateFrame->lineWidth() ; - int h = mDatePicker->sizeHint().height()+2*mDateFrame->lineWidth() ; - int dw = QApplication::desktop()->width(); - int dh = QApplication::desktop()->height(); - mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); - mDateFrame->show(); - } + showDatePickerPopup(); mDatePickerMode = 2; mMoveIncidence = inc ; QDate da; @@ -2487,19 +2477,32 @@ void CalendarView::moveIncidence(Incidence * inc ) //mMoveIncidenceOldDate; mDatePicker->setDate( da ); } -void CalendarView::showDatePicker( ) +void CalendarView::showDatePickerPopup() { - //qDebug("CalendarView::showDatePicker( ) "); - if ( mDateFrame->isVisible() ) + if ( mDateFrame->isVisible() ) mDateFrame->hide(); else { + int offX = 0, offY = 0; +#ifdef DESKTOP_VERSION + int w =mDatePicker->sizeHint().width() ; + int h = mDatePicker->sizeHint().height() ; + int dw = topLevelWidget()->width(); + int dh = topLevelWidget()->height(); + offX = topLevelWidget()->x(); + offY = topLevelWidget()->y(); +#else int w =mDatePicker->sizeHint().width() ; int h = mDatePicker->sizeHint().height() ; int dw = QApplication::desktop()->width(); int dh = QApplication::desktop()->height(); - mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); +#endif + mDateFrame->setGeometry( (dw-w)/2+offX, (dh - h )/2+offY ,w,h ); mDateFrame->show(); } +} +void CalendarView::showDatePicker( ) +{ + showDatePickerPopup(); mDatePickerMode = 1; mDatePicker->setDate( mNavigator->selectedDates().first() ); } |