summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/dialogs/qdialog.cpp2
-rw-r--r--src/gui/dialogs/qinputdialog.cpp3
-rw-r--r--src/gui/styles/qs60style.cpp22
-rw-r--r--src/gui/styles/qs60style_p.h1
4 files changed, 25 insertions, 3 deletions
diff --git a/src/gui/dialogs/qdialog.cpp b/src/gui/dialogs/qdialog.cpp
index 9e0437c..b7a0026 100644
--- a/src/gui/dialogs/qdialog.cpp
+++ b/src/gui/dialogs/qdialog.cpp
@@ -1111,7 +1111,7 @@ QSize QDialog::sizeHint() const
// if size is not fixed, try to adjust it according to S60 layoutting
if (minimumSize() != maximumSize()) {
// In S60, dialogs are always the width of screen (in portrait, regardless of current layout)
- return QSize(qMax(S60->screenHeightInPixels, S60->screenWidthInPixels), QWidget::sizeHint().height());
+ return QSize(qMin(S60->screenHeightInPixels, S60->screenWidthInPixels), QWidget::sizeHint().height());
} else {
return QWidget::sizeHint();
}
diff --git a/src/gui/dialogs/qinputdialog.cpp b/src/gui/dialogs/qinputdialog.cpp
index 700b234..abaaa49 100644
--- a/src/gui/dialogs/qinputdialog.cpp
+++ b/src/gui/dialogs/qinputdialog.cpp
@@ -231,7 +231,10 @@ void QInputDialogPrivate::ensureLayout()
QObject::connect(buttonBox, SIGNAL(rejected()), q, SLOT(reject()));
mainLayout = new QVBoxLayout(q);
+ //we want to let the input dialog grow to available size on Symbian.
+#ifndef Q_OS_SYMBIAN
mainLayout->setSizeConstraint(QLayout::SetMinAndMaxSize);
+#endif
mainLayout->addWidget(label);
mainLayout->addWidget(inputWidget);
mainLayout->addWidget(buttonBox);
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index d39a2ba..53ca28c 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -112,6 +112,8 @@ const short QS60StylePrivate::data[][MAX_PIXELMETRICS] = {
// *** End of generated data ***
};
+QSet<const QWidget *> *QS60StylePrivate::m_autoFillDisabledWidgets = 0;
+
const short *QS60StylePrivate::m_pmPointer = QS60StylePrivate::data[0];
// theme background texture
@@ -152,6 +154,8 @@ const double KTabFontMul = 0.72;
QS60StylePrivate::~QS60StylePrivate()
{
+ delete m_autoFillDisabledWidgets;
+ m_autoFillDisabledWidgets = 0;
clearCaches(); //deletes also background image
deleteThemePalette();
#ifdef Q_WS_S60
@@ -2521,9 +2525,9 @@ int QS60Style::pixelMetric(PixelMetric metric, const QStyleOption *option, const
metricValue = QS60StylePrivate::pixelMetric(PM_LayoutLeftMargin);
}
- if (widget && (metric == PM_LayoutTopMargin))
+ if (widget && (metric == PM_LayoutTopMargin || metric == PM_LayoutLeftMargin || metric == PM_LayoutRightMargin))
if (widget->windowType() == Qt::Dialog)
- //double the top layout margin for dialogs, it is very close to real value
+ //double the layout margins (except bottom) for dialogs, it is very close to real value
//without having to define custom pixel metric
metricValue *= 2;
@@ -3184,6 +3188,13 @@ void QS60Style::polish(QWidget *widget)
}
d->setThemePalette(widget);
d->setFont(widget);
+
+ if (widget->autoFillBackground()) {
+ if (!d->m_autoFillDisabledWidgets)
+ d->m_autoFillDisabledWidgets = new QSet<const QWidget *>;
+ widget->setAutoFillBackground(false);
+ d->m_autoFillDisabledWidgets->insert(widget);
+ }
}
/*!
@@ -3218,6 +3229,13 @@ void QS60Style::unpolish(QWidget *widget)
if (widget)
widget->setPalette(QPalette());
+
+ if (d->m_autoFillDisabledWidgets &&
+ !d->m_autoFillDisabledWidgets->isEmpty() &&
+ d->m_autoFillDisabledWidgets->contains(widget)) {
+ widget->setAutoFillBackground(true);
+ d->m_autoFillDisabledWidgets->remove(widget);
+ }
#if defined(Q_WS_S60) && !defined(QT_NO_PROGRESSBAR)
if (QProgressBar *bar = qobject_cast<QProgressBar *>(widget)) {
diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h
index b46f75e..3d66c40 100644
--- a/src/gui/styles/qs60style_p.h
+++ b/src/gui/styles/qs60style_p.h
@@ -625,6 +625,7 @@ private:
static qint64 m_webPaletteKey;
static QPointer<QWidget> m_pressedWidget;
+ static QSet<const QWidget *> *m_autoFillDisabledWidgets;
#ifdef Q_WS_S60
//list of progress bars having animation running