Changeset 93937 in webkit


Ignore:
Timestamp:
Aug 27, 2011 4:06:22 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

[Qt] Need spin-button implementation
https://bugs.webkit.org/show_bug.cgi?id=65896

Patch by Jarred Nicholls <jarred@sencha.com> on 2011-08-27
Reviewed by Kenneth Rohde Christiansen.

Source/WebCore:

  • platform/qt/RenderThemeQt.cpp:

(WebCore::RenderThemeQt::adjustInnerSpinButtonStyle):
(WebCore::RenderThemeQt::paintInnerSpinButton):

  • platform/qt/RenderThemeQt.h:

LayoutTests:

  • platform/qt/Skipped:
  • platform/qt/fast/forms/input-appearance-spinbutton-disabled-readonly-expected.txt: Added.
  • platform/qt/fast/forms/input-appearance-spinbutton-layer-expected.txt: Added.
  • platform/qt/fast/forms/input-appearance-spinbutton-visibility-expected.txt: Added.
Location:
trunk
Files:
3 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r93936 r93937  
     12011-08-27  Jarred Nicholls  <jarred@sencha.com>
     2
     3        [Qt] Need spin-button implementation
     4        https://bugs.webkit.org/show_bug.cgi?id=65896
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        * platform/qt/Skipped:
     9        * platform/qt/fast/forms/input-appearance-spinbutton-disabled-readonly-expected.txt: Added.
     10        * platform/qt/fast/forms/input-appearance-spinbutton-layer-expected.txt: Added.
     11        * platform/qt/fast/forms/input-appearance-spinbutton-visibility-expected.txt: Added.
     12
    1132011-08-27  Csaba Osztrogonác  <ossy@webkit.org>
    214
  • trunk/LayoutTests/platform/qt/Skipped

    r93936 r93937  
    16711671fast/text/bidi-explicit-embedding-past-end.html
    16721672
    1673 # Need to implement inner-spin-button
    1674 # https://bugs.webkit.org/show_bug.cgi?id=65896
    1675 fast/forms/input-appearance-spinbutton-disabled-readonly.html
    1676 fast/forms/input-appearance-spinbutton-layer.html
    1677 fast/forms/input-appearance-spinbutton-visibility.html
    1678 fast/forms/input-number-events.html
    1679 fast/forms/input-number-large-padding.html
    1680 fast/forms/input-number-size.html
    1681 fast/forms/input-spinbutton-capturing.html
    1682 fast/forms/spin-button-gets-disabled-or-readonly.html
    1683 
    16841673# [Qt] fast/dom/beforeload/script-before-load-dynamic.html is crashy-flakey
    16851674# https://bugs.webkit.org/show_bug.cgi?id=41452
  • trunk/Source/WebCore/ChangeLog

    r93935 r93937  
     12011-08-27  Jarred Nicholls  <jarred@sencha.com>
     2
     3        [Qt] Need spin-button implementation
     4        https://bugs.webkit.org/show_bug.cgi?id=65896
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        * platform/qt/RenderThemeQt.cpp:
     9        (WebCore::RenderThemeQt::adjustInnerSpinButtonStyle):
     10        (WebCore::RenderThemeQt::paintInnerSpinButton):
     11        * platform/qt/RenderThemeQt.h:
     12
    1132011-08-26  Xiaomei Ji  <xji@chromium.org>
    214
  • trunk/Source/WebCore/platform/qt/RenderThemeQt.cpp

    r93702 r93937  
    10691069}
    10701070
     1071void RenderThemeQt::adjustInnerSpinButtonStyle(CSSStyleSelector* selector, RenderStyle* style,
     1072                                               Element* e) const
     1073{
     1074    // Use the same width as our native scrollbar
     1075    int width = ScrollbarTheme::nativeTheme()->scrollbarThickness();
     1076    style->setWidth(Length(width, Fixed));
     1077    style->setMinWidth(Length(width, Fixed));
     1078}
     1079
     1080bool RenderThemeQt::paintInnerSpinButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& rect)
     1081{
     1082    StylePainter p(this, paintInfo);
     1083    if (!p.isValid())
     1084       return true;
     1085
     1086    QStyleOptionSpinBox option;
     1087    initStyleOption(p.widget, option);
     1088    option.subControls = QStyle::SC_SpinBoxUp | QStyle::SC_SpinBoxDown;
     1089    if (!isReadOnlyControl(o)) {
     1090        if (isEnabled(o))
     1091            option.stepEnabled = QAbstractSpinBox::StepUpEnabled | QAbstractSpinBox::StepDownEnabled;
     1092        if (isPressed(o)) {
     1093            option.state |= QStyle::State_Sunken;
     1094            if (isSpinUpButtonPartPressed(o))
     1095                option.activeSubControls = QStyle::SC_SpinBoxUp;
     1096            else
     1097                option.activeSubControls = QStyle::SC_SpinBoxDown;
     1098        }
     1099    }
     1100
     1101    IntRect buttonRect = rect;
     1102    buttonRect.inflateY(-2);
     1103#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC)
     1104    // QMacStyle will position the aqua buttons flush to the right.
     1105    // This will move them more left for better style, a la
     1106    // Chromium look & feel.
     1107    if (qobject_cast<QMacStyle*>(p.style)) {
     1108        buttonRect.inflateX(-4);
     1109        // Render mini aqua spin buttons for QMacStyle to fit nicely into
     1110        // the editor area, like Chromium.
     1111        option.state |= QStyle::State_Mini;
     1112#else
     1113    {
     1114        buttonRect.inflateX(-2);
     1115#endif
     1116    }
     1117    option.rect = buttonRect;
     1118
     1119    p.drawComplexControl(QStyle::CC_SpinBox, option);
     1120    return false;
     1121}
     1122
    10711123bool RenderThemeQt::supportsFocus(ControlPart appearance) const
    10721124{
  • trunk/Source/WebCore/platform/qt/RenderThemeQt.h

    r89040 r93937  
    138138    virtual void adjustSearchFieldResultsDecorationStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
    139139    virtual bool paintSearchFieldResultsDecoration(RenderObject*, const PaintInfo&, const IntRect&);
     140
     141    virtual void adjustInnerSpinButtonStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
     142    virtual bool paintInnerSpinButton(RenderObject*, const PaintInfo&, const IntRect&);
    140143
    141144#if ENABLE(PROGRESS_TAG)
Note: See TracChangeset for help on using the changeset viewer.