author | zautrix <zautrix> | 2005-02-08 14:12:31 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-08 14:12:31 (UTC) |
commit | 41111b332c2a5f1b2ec152df309b9199f5e9c921 (patch) (side-by-side diff) | |
tree | 3a2e5c5a25cdb52f542b2fe84a03f94599be2fe3 /korganizer/mainwindow.cpp | |
parent | 9927a063f34bb826a4b5f7f7029308c9c66acbce (diff) | |
download | kdepimpi-41111b332c2a5f1b2ec152df309b9199f5e9c921.zip kdepimpi-41111b332c2a5f1b2ec152df309b9199f5e9c921.tar.gz kdepimpi-41111b332c2a5f1b2ec152df309b9199f5e9c921.tar.bz2 |
fixes
-rw-r--r-- | korganizer/mainwindow.cpp | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 7810bf9..61c39f5 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -2029,18 +2029,35 @@ void MainWindow::printCal() void MainWindow::weekAction() { int month; KPopupFrame* popup = new KPopupFrame(this); - int size = 12; - if ( QApplication::desktop()->width() >= 480 ) - size = 18; - KDateInternalWeekPicker* picker = new KDateInternalWeekPicker(size, popup); + KDateInternalWeekPicker* picker = new KDateInternalWeekPicker(10, popup); // ----- picker->resize(picker->sizeHint()); popup->setMainWidget(picker); picker->setFocus(); connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int))); - if(popup->exec(iconToolBar->mapToGlobal(QPoint(0, iconToolBar->height())))) + int x = 0; + int y = iconToolBar->height(); + int dX = 0; + int dY = 0; + if ( iconToolBar->orientation () == Qt:: Horizontal ) { + if ( iconToolBar->y() > height()/2 ) { + dY = iconToolBar->height()+picker->sizeHint().height(); + y = 0; + } + } else { + if ( iconToolBar->x() > width()/2 ) { // right side + x=0; + dX= iconToolBar->width()+picker->sizeHint().width(); + y = 0; + } else { + x= iconToolBar->width(); + y = 0; + } + } + qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() ); + if(popup->exec(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY)))) { month = picker->getResult(); emit selectWeek ( month ); //qDebug("weekSelected %d ", month); |