summaryrefslogtreecommitdiffstats
path: root/src/gui/dialogs
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2010-07-15 13:14:37 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2010-07-15 13:14:37 (GMT)
commit8106f716043c22d71ff3dcdf9cd8a4db258fa81f (patch)
treefef8ef2bcc78da549037c94451058fde10268edd /src/gui/dialogs
parenta98bda4b42b068c9c3220ae2aded41a263387ac2 (diff)
parent03c01176ebf423085e56ceabcf8335ca5027a786 (diff)
downloadQt-8106f716043c22d71ff3dcdf9cd8a4db258fa81f.zip
Qt-8106f716043c22d71ff3dcdf9cd8a4db258fa81f.tar.gz
Qt-8106f716043c22d71ff3dcdf9cd8a4db258fa81f.tar.bz2
Merge remote branch 'origin/4.7' into qt-master-from-4.7
Conflicts: src/gui/kernel/qapplication.h
Diffstat (limited to 'src/gui/dialogs')
-rw-r--r--src/gui/dialogs/qdialog.cpp37
-rw-r--r--src/gui/dialogs/qdialog.h6
-rw-r--r--src/gui/dialogs/qprogressdialog.cpp11
3 files changed, 35 insertions, 19 deletions
diff --git a/src/gui/dialogs/qdialog.cpp b/src/gui/dialogs/qdialog.cpp
index a6bd78a..9e0437c 100644
--- a/src/gui/dialogs/qdialog.cpp
+++ b/src/gui/dialogs/qdialog.cpp
@@ -67,12 +67,12 @@ extern bool qt_wince_is_smartphone(); //is defined in qguifunctions_wce.cpp
#elif defined(Q_OS_SYMBIAN)
# include "qfiledialog.h"
# include "qfontdialog.h"
-# include "qcolordialog.h"
# include "qwizard.h"
+# include "private/qt_s60_p.h"
#endif
#if defined(Q_WS_S60)
-#include "private/qt_s60_p.h"
+#include <AknUtils.h> // AknLayoutUtils
#endif
#ifndef SPI_GETSNAPTODEFBUTTON
@@ -393,7 +393,7 @@ void QDialogPrivate::resetModalitySetByOpen()
resetModalityTo = -1;
}
-#if defined(Q_WS_WINCE) || defined(Q_WS_S60)
+#if defined(Q_WS_WINCE) || defined(Q_OS_SYMBIAN)
#ifdef Q_WS_WINCE_WM
void QDialogPrivate::_q_doneAction()
{
@@ -413,7 +413,7 @@ bool QDialog::event(QEvent *e)
accept();
result = true;
}
-#else
+#elif defined(Q_WS_S60)
if ((e->type() == QEvent::StyleChange) || (e->type() == QEvent::Resize )) {
if (!testAttribute(Qt::WA_Moved)) {
Qt::WindowStates state = windowState();
@@ -423,6 +423,7 @@ bool QDialog::event(QEvent *e)
setWindowState(state);
}
}
+ // TODO is Symbian, non-S60 behaviour required?
#endif
return result;
}
@@ -527,14 +528,19 @@ int QDialog::exec()
#endif //QT_NO_MENUBAR
#endif //Q_WS_WINCE_WM
+ bool showSystemDialogFullScreen = false;
#ifdef Q_OS_SYMBIAN
if (qobject_cast<QFileDialog *>(this) || qobject_cast<QFontDialog *>(this) ||
- qobject_cast<QColorDialog *>(this) || qobject_cast<QWizard *>(this))
- showMaximized();
- else
+ qobject_cast<QWizard *>(this)) {
+ showSystemDialogFullScreen = true;
+ }
#endif // Q_OS_SYMBIAN
- show();
+ if (showSystemDialogFullScreen) {
+ setWindowFlags(windowFlags() | Qt::WindowSoftkeysVisibleHint);
+ setWindowState(Qt::WindowFullScreen);
+ }
+ show();
#ifdef Q_WS_MAC
d->mac_nativeDialogModalHelp();
@@ -818,8 +824,8 @@ void QDialog::adjustPosition(QWidget* w)
return;
#endif
-#ifdef Q_WS_S60
- if (s60AdjustedPosition())
+#ifdef Q_OS_SYMBIAN
+ if (symbianAdjustedPosition())
//dialog has already been positioned
return;
#endif
@@ -887,13 +893,12 @@ void QDialog::adjustPosition(QWidget* w)
move(p);
}
-#if defined(Q_WS_S60)
+#if defined(Q_OS_SYMBIAN)
/*! \internal */
-bool QDialog::s60AdjustedPosition()
+bool QDialog::symbianAdjustedPosition()
{
+#if defined(Q_WS_S60)
QPoint p;
- const QSize mainAreaSize = QApplication::desktop()->availableGeometry(QCursor::pos()).size();
- const int statusPaneHeight = (S60->screenHeightInPixels - mainAreaSize.height())>>1;
const bool doS60Positioning = !(isFullScreen()||isMaximized());
if (doS60Positioning) {
// naive way to deduce screen orientation
@@ -937,6 +942,10 @@ bool QDialog::s60AdjustedPosition()
move(p);
}
return doS60Positioning;
+#else
+ // TODO - check positioning requirement for Symbian, non-s60
+ return false;
+#endif
}
#endif
diff --git a/src/gui/dialogs/qdialog.h b/src/gui/dialogs/qdialog.h
index 777256a..b2ba93c 100644
--- a/src/gui/dialogs/qdialog.h
+++ b/src/gui/dialogs/qdialog.h
@@ -107,7 +107,7 @@ public Q_SLOTS:
protected:
QDialog(QDialogPrivate &, QWidget *parent, Qt::WindowFlags f = 0);
-#if defined(Q_WS_WINCE) || defined(Q_WS_S60)
+#if defined(Q_WS_WINCE) || defined(Q_OS_SYMBIAN)
bool event(QEvent *e);
#endif
void keyPressEvent(QKeyEvent *);
@@ -123,8 +123,8 @@ private:
Q_DECLARE_PRIVATE(QDialog)
Q_DISABLE_COPY(QDialog)
-#if defined(Q_WS_S60)
- bool s60AdjustedPosition();
+#if defined(Q_OS_SYMBIAN)
+ bool symbianAdjustedPosition();
#endif
diff --git a/src/gui/dialogs/qprogressdialog.cpp b/src/gui/dialogs/qprogressdialog.cpp
index a2d7b23..d64c847 100644
--- a/src/gui/dialogs/qprogressdialog.cpp
+++ b/src/gui/dialogs/qprogressdialog.cpp
@@ -153,6 +153,13 @@ void QProgressDialogPrivate::layout()
const bool centered =
bool(q->style()->styleHint(QStyle::SH_ProgressDialog_CenterCancelButton, 0, q));
+ int additionalSpacing = 0;
+#ifdef Q_OS_SYMBIAN
+ //In Symbian, we need to have wider margins for dialog borders, as the actual border is some pixels
+ //inside the dialog area (to enable transparent borders)
+ additionalSpacing = mlr;
+#endif
+
QSize cs = cancel ? cancel->sizeHint() : QSize(0,0);
QSize bh = bar->sizeHint();
int cspc;
@@ -185,8 +192,8 @@ void QProgressDialogPrivate::layout()
}
if (label)
- label->setGeometry(mlr, 0, q->width()-mlr*2, lh);
- bar->setGeometry(mlr, lh+sp, q->width()-mlr*2, bh.height());
+ label->setGeometry(mlr, additionalSpacing, q->width() - mlr * 2, lh);
+ bar->setGeometry(mlr, lh + sp + additionalSpacing, q->width() - mlr * 2, bh.height());
}
void QProgressDialogPrivate::retranslateStrings()