summaryrefslogtreecommitdiff
path: root/Source/WebKit/qt/WidgetSupport
diff options
context:
space:
mode:
authorZeno Albisser <zeno@webkit.org>2012-12-05 16:48:30 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2012-12-05 18:03:44 +0100
commitc37c507e58da50f4f94db998c19e355cc84e53d8 (patch)
tree896cc3c478143b028c81b230f98548a12645294d /Source/WebKit/qt/WidgetSupport
parent0d84466d757621046458c609fb3ac640a06cab4f (diff)
downloadqtwebkit-5.0.0-rc1.tar.gz
[Qt][Mac] QWebView disappears when the system tries to hide the scrollbars.v5.0.0-rc1
https://bugs.webkit.org/show_bug.cgi?id=104116 This is a workaround for an issue in Qt that was caused by Change-Id: I2000fa50d46b153e981ceafc12a53932a196382e in qtbase. Since we are drawing the scrollbars by ourselves, there is no widget available that needs to be hidden by the style. Therefore we have to disable transient scrollbar animations on Mac. Patch by: J-P Nurmi <jpnurmi@digia.com> Reviewed by Simon Hausmann. * WidgetSupport/QStyleFacadeImp.cpp: (WebKit::QStyleFacadeImp::paintScrollBar): Change-Id: Ia9ff6d6634aecfe574ba2842258fc003d4a5c665 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'Source/WebKit/qt/WidgetSupport')
-rw-r--r--Source/WebKit/qt/WidgetSupport/QStyleFacadeImp.cpp27
1 files changed, 11 insertions, 16 deletions
diff --git a/Source/WebKit/qt/WidgetSupport/QStyleFacadeImp.cpp b/Source/WebKit/qt/WidgetSupport/QStyleFacadeImp.cpp
index bd6be1e47..7e2b8cab7 100644
--- a/Source/WebKit/qt/WidgetSupport/QStyleFacadeImp.cpp
+++ b/Source/WebKit/qt/WidgetSupport/QStyleFacadeImp.cpp
@@ -454,23 +454,18 @@ void QStyleFacadeImp::paintScrollBar(QPainter *painter, const QStyleFacadeOption
MappedStyleOption<QStyleOptionSlider> opt(widget, proxyOption);
-#ifdef Q_OS_MAC
- // FIXME: We also need to check the widget style but today ScrollbarTheme is not aware of the page so we
- // can't get the widget.
- if (m_style->inherits("QMacStyle"))
- m_style->drawComplexControl(QStyle::CC_ScrollBar, &opt, painter, widget);
- else
-#endif
- {
- // The QStyle expects the background to be already filled.
- painter->fillRect(opt.rect, opt.palette.background());
-
- const QPoint topLeft = opt.rect.topLeft();
- painter->translate(topLeft);
- opt.rect.moveTo(QPoint(0, 0));
- style()->drawComplexControl(QStyle::CC_ScrollBar, &opt, painter, widget);
- opt.rect.moveTo(topLeft);
+ if (m_style->inherits("QMacStyle")) {
+ // FIXME: Disable transient scrollbar animations on OSX to avoid hiding the whole webview with the scrollbar fade out animation.
+ opt.styleObject = 0;
}
+
+ painter->fillRect(opt.rect, opt.palette.background());
+
+ const QPoint topLeft = opt.rect.topLeft();
+ painter->translate(topLeft);
+ opt.rect.moveTo(QPoint(0, 0));
+ style()->drawComplexControl(QStyle::CC_ScrollBar, &opt, painter, widget);
+ opt.rect.moveTo(topLeft);
}
QObject* QStyleFacadeImp::widgetForPainter(QPainter* painter)