Tor Arne Vestbø <tavestbo@trolltech.com>
authorhausmann@webkit.org <hausmann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Apr 2008 08:53:44 +0000 (08:53 +0000)
committerhausmann@webkit.org <hausmann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Apr 2008 08:53:44 +0000 (08:53 +0000)
Render text areas using Qt (ensures proper style).

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

WebCore/ChangeLog
WebCore/platform/qt/RenderThemeQt.cpp
WebCore/platform/qt/RenderThemeQt.h

index b23de60..f994354 100644 (file)
@@ -2,6 +2,19 @@
 
         Reviewed by Simon.
 
+        Render text areas using Qt (ensures proper style).
+
+        * platform/qt/RenderThemeQt.cpp:
+        (WebCore::RenderThemeQt::paintTextField):
+        (WebCore::RenderThemeQt::adjustTextFieldStyle):
+        (WebCore::RenderThemeQt::paintTextArea):
+        (WebCore::RenderThemeQt::supportsFocus):
+        * platform/qt/RenderThemeQt.h:
+
+2008-04-24  Tor Arne Vestbø  <tavestbo@trolltech.com>
+
+        Reviewed by Simon.
+
         Make mouse wheel events over scrollbars behave the same as in Qt, i.e. both
         horizontal and vertical wheel events will scroll the view in the orientation
         of the scrollbar underneath the cursor.
index 8554938..9be3332 100644 (file)
@@ -253,6 +253,7 @@ bool RenderThemeQt::paintTextField(RenderObject* o, const RenderObject::PaintInf
     QStyleOptionFrameV2 panel;
     if (p.widget)
         panel.initFrom(p.widget);
+
     panel.rect = r;
     panel.lineWidth = p.style->pixelMetric(QStyle::PM_DefaultFrameWidth, &panel, p.widget);
     panel.state |= QStyle::State_Sunken;
@@ -260,7 +261,9 @@ bool RenderThemeQt::paintTextField(RenderObject* o, const RenderObject::PaintInf
 
     // Get the correct theme data for a button
     EAppearance appearance = applyTheme(panel, o);
-    Q_ASSERT(appearance == TextFieldAppearance || appearance == SearchFieldAppearance);
+    Q_ASSERT(appearance == TextFieldAppearance
+            || appearance == SearchFieldAppearance
+            || appearance == TextAreaAppearance);
 
     // Now paint the text field.
     p.drawPrimitive(QStyle::PE_PanelLineEdit, panel);
@@ -270,6 +273,17 @@ bool RenderThemeQt::paintTextField(RenderObject* o, const RenderObject::PaintInf
 
 void RenderThemeQt::adjustTextFieldStyle(CSSStyleSelector*, RenderStyle* style, Element*) const
 {
+    style->setBackgroundColor(Color::transparent);
+}
+
+bool RenderThemeQt::paintTextArea(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r)
+{
+    return paintTextField(o, i, r);
+}
+
+void RenderThemeQt::adjustTextAreaStyle(CSSStyleSelector* selector, RenderStyle* style, Element* element) const
+{
+    adjustTextFieldStyle(selector, style, element);
 }
 
 void RenderThemeQt::adjustMenuListStyle(CSSStyleSelector*, RenderStyle* style, Element*) const
@@ -406,6 +420,7 @@ bool RenderThemeQt::supportsFocus(EAppearance appearance) const
         case PushButtonAppearance:
         case ButtonAppearance:
         case TextFieldAppearance:
+        case TextAreaAppearance:
         case MenulistAppearance:
         case RadioAppearance:
         case CheckboxAppearance:
index 70735cc..2269ca8 100644 (file)
@@ -82,6 +82,9 @@ protected:
     virtual bool paintTextField(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
     virtual void adjustTextFieldStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
 
+    virtual bool paintTextArea(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
+    virtual void adjustTextAreaStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
+
     virtual bool paintMenuList(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r);
     virtual void adjustMenuListStyle(CSSStyleSelector*, RenderStyle*, Element*) const;