Morten Johan Sørvig <msorvig@trolltech.com>
authorhausmann@webkit.org <hausmann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Apr 2008 13:30:03 +0000 (13:30 +0000)
committerhausmann@webkit.org <hausmann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Apr 2008 13:30:03 +0000 (13:30 +0000)
Work around QMacStyle bug in repainting the vertical scrollbar.

We draw the scrollbar using HITheme but somehow the translation and the
clipping we previously set using ClipCGContextToRegion is ignored. Drawing
without the translation fixes the clip.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@32484 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/platform/qt/PlatformScrollBarQt.cpp

index 8890774..5cf0af3 100644 (file)
@@ -1,3 +1,16 @@
+2008-04-24  Morten Johan Sørvig  <msorvig@trolltech.com>
+
+        Reviewed by Simon.
+
+        Work around QMacStyle bug in repainting the vertical scrollbar.
+
+        We draw the scrollbar using HITheme but somehow the translation and the
+        clipping we previously set using ClipCGContextToRegion is ignored. Drawing
+        without the translation fixes the clip.
+
+        * platform/qt/PlatformScrollBarQt.cpp:
+        (WebCore::PlatformScrollbar::paint):
+
 2008-04-24  Holger Hans Peter Freyther  <zecke@selfish.org>
 
         Reviewed by Simon.
index 0839db8..574f1a4 100644 (file)
@@ -172,10 +172,14 @@ void PlatformScrollbar::paint(GraphicsContext* graphicsContext, const IntRect& d
     }
 
     const QPoint topLeft = m_opt.rect.topLeft();
+#ifdef Q_WS_MAC
+    QApplication::style()->drawComplexControl(QStyle::CC_ScrollBar, &m_opt, p, 0);
+#else
     p->translate(topLeft);
     m_opt.rect.moveTo(QPoint(0, 0));
     QApplication::style()->drawComplexControl(QStyle::CC_ScrollBar, &m_opt, p, 0);
     m_opt.rect.moveTo(topLeft);
+#endif
     p->restore();
 }