summaryrefslogtreecommitdiffstats
path: root/src/gui/dialogs
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/dialogs')
-rw-r--r--src/gui/dialogs/qdialog.cpp36
-rw-r--r--src/gui/dialogs/qdialog.h6
-rw-r--r--src/gui/dialogs/qprogressdialog.cpp11
3 files changed, 35 insertions, 18 deletions
diff --git a/src/gui/dialogs/qdialog.cpp b/src/gui/dialogs/qdialog.cpp
index a6bd78a..a2adb05 100644
--- a/src/gui/dialogs/qdialog.cpp
+++ b/src/gui/dialogs/qdialog.cpp
@@ -71,8 +71,9 @@ extern bool qt_wince_is_smartphone(); //is defined in qguifunctions_wce.cpp
# include "qwizard.h"
#endif
-#if defined(Q_WS_S60)
#include "private/qt_s60_p.h"
+#if defined(Q_WS_S60)
+#include <AknUtils.h> // AknLayoutUtils
#endif
#ifndef SPI_GETSNAPTODEFBUTTON
@@ -393,7 +394,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 +414,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 +424,7 @@ bool QDialog::event(QEvent *e)
setWindowState(state);
}
}
+ // TODO is Symbian, non-S60 behaviour required?
#endif
return result;
}
@@ -527,14 +529,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<QColorDialog *>(this) || 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 +825,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 +894,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 +943,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()