summaryrefslogtreecommitdiffstats
path: root/src/gui/dialogs/qfiledialog_mac.mm
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@nokia.com>2009-05-04 08:07:46 (GMT)
committerRichard Moe Gustavsen <richard.gustavsen@nokia.com>2009-05-04 08:07:46 (GMT)
commit8582f038ab46e26e04a97a481ebce6f89f5b3987 (patch)
treed01bdf01e1c33c1e39bd066c4a081694a42e756c /src/gui/dialogs/qfiledialog_mac.mm
parent446085a8b3f22d7e2735b62b4511907e7aaba82a (diff)
downloadQt-8582f038ab46e26e04a97a481ebce6f89f5b3987.zip
Qt-8582f038ab46e26e04a97a481ebce6f89f5b3987.tar.gz
Qt-8582f038ab46e26e04a97a481ebce6f89f5b3987.tar.bz2
QFileDialog::getOpenFileNames() is not shown at the correct position
The correct behaviour for native file dialogs on mac is to use the previous size and location settings when reopening the dialog. So we implement this behaviour with this change Task-number: 250182 Reviewed-by: Trenton Schulz
Diffstat (limited to 'src/gui/dialogs/qfiledialog_mac.mm')
-rw-r--r--src/gui/dialogs/qfiledialog_mac.mm19
1 files changed, 3 insertions, 16 deletions
diff --git a/src/gui/dialogs/qfiledialog_mac.mm b/src/gui/dialogs/qfiledialog_mac.mm
index 90af9fc..39a231b 100644
--- a/src/gui/dialogs/qfiledialog_mac.mm
+++ b/src/gui/dialogs/qfiledialog_mac.mm
@@ -911,8 +911,9 @@ void QFileDialogPrivate::createNavServicesDialog()
navOptions.windowTitle = QCFString::toCFStringRef(q->windowTitle());
- static const int w = 450, h = 350;
- navOptions.location.h = navOptions.location.v = -1;
+ navOptions.location.h = -1;
+ navOptions.location.v = -1;
+
QWidget *parent = q->parentWidget();
if (parent && parent->isVisible()) {
WindowClass wclass;
@@ -920,20 +921,6 @@ void QFileDialogPrivate::createNavServicesDialog()
parent = parent->window();
QString s = parent->windowTitle();
navOptions.clientName = QCFString::toCFStringRef(s);
- navOptions.location.h = (parent->x() + (parent->width() / 2)) - (w / 2);
- navOptions.location.v = (parent->y() + (parent->height() / 2)) - (h / 2);
-
- QRect r = QApplication::desktop()->screenGeometry(
- QApplication::desktop()->screenNumber(parent));
- const int border = 10;
- if (navOptions.location.h + w > r.right())
- navOptions.location.h -= (navOptions.location.h + w) - r.right() + border;
- if (navOptions.location.v + h > r.bottom())
- navOptions.location.v -= (navOptions.location.v + h) - r.bottom() + border;
- if (navOptions.location.h < r.left())
- navOptions.location.h = r.left() + border;
- if (navOptions.location.v < r.top())
- navOptions.location.v = r.top() + border;
}
filterInfo.currentSelection = 0;