Fix rendering of lineedits and remove the spurious
authorzack <zack@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Feb 2007 11:18:01 +0000 (11:18 +0000)
committerzack <zack@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Feb 2007 11:18:01 +0000 (11:18 +0000)
padding on push-buttons.
r=Lars

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

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

index c2d7059382e1cdb3c13f12bc97c8c9b0a5eb0f28..ad6ce4ed69663a32cf543f8f1b79079ac6c7562c 100644 (file)
@@ -1,3 +1,16 @@
+2007-02-21  Zack Rusin  <zrusin@trolltech.com>
+
+        Reviewed by Lars
+
+        Fix rendering of lineedits and remove the spurious
+        padding on push-buttons.
+
+        * platform/qt/RenderThemeQt.cpp:
+        (WebCore::RenderThemeQt::baselinePosition):
+        (WebCore::RenderThemeQt::adjustTextFieldStyle):
+        (WebCore::RenderThemeQt::sizeForFont):
+        (WebCore::RenderThemeQt::setButtonPadding):
+
 2007-02-21  Zack Rusin  <zrusin@trolltech.com>
 
         Fix compilation.
index d40625a95c8bd63e31b715b1cec0f930f0897c31..c82d7335c8784cb76ed86221477369fae6e0a14a 100644 (file)
@@ -39,6 +39,7 @@
 
 #include "Color.h"
 #include "Document.h"
+#include "Font.h"
 #include "RenderTheme.h"
 #include "GraphicsContext.h"
 
@@ -67,7 +68,8 @@ bool RenderThemeQt::supportsFocusRing(const RenderStyle* style) const
 
 short RenderThemeQt::baselinePosition(const RenderObject* o) const
 {
-    if (o->style()->appearance() == CheckboxAppearance || o->style()->appearance() == RadioAppearance)
+    if (o->style()->appearance() == CheckboxAppearance ||
+        o->style()->appearance() == RadioAppearance)
         return o->marginTop() + o->height() - 2; // Same as in old khtml
     return RenderTheme::baselinePosition(o);
 }
@@ -275,15 +277,6 @@ bool RenderThemeQt::paintTextField(RenderObject* o, const RenderObject::PaintInf
 
 void RenderThemeQt::adjustTextFieldStyle(CSSStyleSelector*, RenderStyle* style, Element*) const
 {
-    style->resetBorder();
-
-    // Height is locked to auto.
-    style->setHeight(Length(Auto));
-
-    // White-space is locked to pre
-    style->setWhiteSpace(PRE);
-
-    setPrimitiveSize(style);
 }
 
 void RenderThemeQt::adjustMenuListStyle(CSSStyleSelector*, RenderStyle* style, Element*) const
@@ -464,7 +457,7 @@ void RenderThemeQt::setSizeFromFont(RenderStyle* style) const
 
 IntSize RenderThemeQt::sizeForFont(RenderStyle* style) const
 {
-    const QFontMetrics &fm = QApplication::fontMetrics();
+    const QFontMetrics fm(style->font());
     QSize size(0, 0);
     switch (style->appearance()) {
     case CheckboxAppearance: {
@@ -517,7 +510,7 @@ void RenderThemeQt::setButtonPadding(RenderStyle* style) const
     const int padding = 8;
     style->setPaddingLeft(Length(padding, Fixed));
     style->setPaddingRight(Length(padding, Fixed));
-    style->setPaddingTop(Length(1, Fixed));
+    style->setPaddingTop(Length(0, Fixed));
     style->setPaddingBottom(Length(0, Fixed));
 }