diff options
Diffstat (limited to 'src/gui/styles/qs60style.cpp')
-rw-r--r-- | src/gui/styles/qs60style.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
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)) { |