Changeset 94419 in webkit


Ignore:
Timestamp:
Sep 2, 2011 8:57:44 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

Source/WebCore: [Qt] number input not rendering spin buttons properly in RTL direction
https://bugs.webkit.org/show_bug.cgi?id=67445

Properly render Qt's number input with RTL direction, and fix Plastique styling.

Patch by Jarred Nicholls <jarred@sencha.com> on 2011-09-02
Reviewed by Andreas Kling.

  • platform/qt/RenderThemeQt.cpp:

(WebCore::RenderThemeQt::paintInnerSpinButton):

LayoutTests: [Qt] number input not rendering spin buttons properly in RTL direction
https://bugs.webkit.org/show_bug.cgi?id=67445

New baseline for Qt number input with RTL direction.

Patch by Jarred Nicholls <jarred@sencha.com> on 2011-09-02
Reviewed by Andreas Kling.

  • platform/qt/fast/forms/input-appearance-number-rtl-expected.png:
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r94418 r94419  
     12011-09-02  Jarred Nicholls  <jarred@sencha.com>
     2
     3        [Qt] number input not rendering spin buttons properly in RTL direction
     4        https://bugs.webkit.org/show_bug.cgi?id=67445
     5       
     6        New baseline for Qt number input with RTL direction.
     7
     8        Reviewed by Andreas Kling.
     9
     10        * platform/qt/fast/forms/input-appearance-number-rtl-expected.png:
     11
    1122011-09-02  Arko Saha  <nghq36@motorola.com>
    213
  • trunk/Source/WebCore/ChangeLog

    r94418 r94419  
     12011-09-02  Jarred Nicholls  <jarred@sencha.com>
     2
     3        [Qt] number input not rendering spin buttons properly in RTL direction
     4        https://bugs.webkit.org/show_bug.cgi?id=67445
     5       
     6        Properly render Qt's number input with RTL direction, and fix Plastique styling.
     7
     8        Reviewed by Andreas Kling.
     9
     10        * platform/qt/RenderThemeQt.cpp:
     11        (WebCore::RenderThemeQt::paintInnerSpinButton):
     12
    1132011-09-02  Arko Saha  <nghq36@motorola.com>
    214
  • trunk/Source/WebCore/platform/qt/RenderThemeQt.cpp

    r93955 r94419  
    7777#include <QMacStyle>
    7878#include <QPainter>
     79#include <QPlastiqueStyle>
    7980#include <QPushButton>
    8081#include <QStyleFactory>
     
    10991100        }
    11001101    }
     1102    // Render the spin buttons for LTR or RTL accordingly.
     1103    option.direction = o->style()->isLeftToRightDirection() ? Qt::LeftToRight : Qt::RightToLeft;
    11011104
    11021105    IntRect buttonRect = rect;
    1103     buttonRect.inflateY(-2);
     1106    // Default to moving the buttons a little bit within the editor frame.
     1107    int inflateX = -2;
     1108    int inflateY = -2;
    11041109#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC)
    11051110    // QMacStyle will position the aqua buttons flush to the right.
    1106     // This will move them more left for better style, a la
     1111    // This will move them more within the control for better style, a la
    11071112    // Chromium look & feel.
    11081113    if (qobject_cast<QMacStyle*>(p.style)) {
    1109         buttonRect.inflateX(-4);
     1114        inflateX = -4;
    11101115        // Render mini aqua spin buttons for QMacStyle to fit nicely into
    11111116        // the editor area, like Chromium.
    11121117        option.state |= QStyle::State_Mini;
    1113 #else
    1114     {
    1115         buttonRect.inflateX(-2);
    1116 #endif
    1117     }
     1118    }
     1119#endif
     1120#if defined(Q_WS_X11) && !defined(QT_NO_STYLE_PLASTIQUE)
     1121    // QPlastiqueStyle looks best when the spin buttons are flush with the frame's edge.
     1122    if (qobject_cast<QPlastiqueStyle*>(p.style)) {
     1123        inflateX = 0;
     1124        inflateY = 0;
     1125    }
     1126#endif
     1127
     1128    buttonRect.inflateX(inflateX);
     1129    buttonRect.inflateY(inflateY);
    11181130    option.rect = buttonRect;
    11191131
Note: See TracChangeset for help on using the changeset viewer.