summaryrefslogtreecommitdiffabout
path: root/korganizer/calendarview.cpp
authorzautrix <zautrix>2005-02-08 14:12:31 (UTC)
committer zautrix <zautrix>2005-02-08 14:12:31 (UTC)
commit41111b332c2a5f1b2ec152df309b9199f5e9c921 (patch) (side-by-side diff)
tree3a2e5c5a25cdb52f542b2fe84a03f94599be2fe3 /korganizer/calendarview.cpp
parent9927a063f34bb826a4b5f7f7029308c9c66acbce (diff)
downloadkdepimpi-41111b332c2a5f1b2ec152df309b9199f5e9c921.zip
kdepimpi-41111b332c2a5f1b2ec152df309b9199f5e9c921.tar.gz
kdepimpi-41111b332c2a5f1b2ec152df309b9199f5e9c921.tar.bz2
fixes
Diffstat (limited to 'korganizer/calendarview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp33
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
@@ -2459,19 +2459,9 @@ 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;
if ( mMoveIncidence->type() == "Todo" ) {
@@ -2486,21 +2476,34 @@ void CalendarView::moveIncidence(Incidence * inc )
//PENDING set date for recurring incidence to date of recurrence
//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() );
}