Changeset 247827 in webkit


Ignore:
Timestamp:
Jul 25, 2019 11:04:15 AM (5 years ago)
Author:
commit-queue@webkit.org
Message:

[WPE] Draw other button types
https://bugs.webkit.org/show_bug.cgi?id=199377

Patch by Joshua Watt <JPEW.hacker@gmail.com> on 2019-07-25
Reviewed by Michael Catanzaro.

There are other button types that should be drawn with the default style
besides just push buttons.

  • platform/wpe/ThemeWPE.cpp:

(WebCore::ThemeWPE::paint):
(WebCore::ThemeWPE::paintButton):

  • platform/wpe/ThemeWPE.h:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r247826 r247827  
     12019-07-25  Joshua Watt  <JPEW.hacker@gmail.com>
     2
     3        [WPE] Draw other button types
     4        https://bugs.webkit.org/show_bug.cgi?id=199377
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        There are other button types that should be drawn with the default style
     9        besides just push buttons.
     10
     11        * platform/wpe/ThemeWPE.cpp:
     12        (WebCore::ThemeWPE::paint):
     13        (WebCore::ThemeWPE::paintButton):
     14        * platform/wpe/ThemeWPE.h:
     15
    1162019-07-25  Said Abou-Hallawa  <sabouhallawa@apple.com>
    217
  • trunk/Source/WebCore/platform/wpe/ThemeWPE.cpp

    r231557 r247827  
    6868        break;
    6969    case PushButtonPart:
    70         paintButton(states, context, zoomedRect, zoomFactor);
     70    case DefaultButtonPart:
     71    case ButtonPart:
     72    case SquareButtonPart:
     73        paintButton(part, states, context, zoomedRect, zoomFactor);
    7174        break;
    7275    default:
     
    130133}
    131134
    132 void ThemeWPE::paintButton(ControlStates& states, GraphicsContext& context, const FloatRect& zoomedRect, float)
     135void ThemeWPE::paintButton(ControlPart part, ControlStates& states, GraphicsContext& context, const FloatRect& zoomedRect, float)
    133136{
    134137    GraphicsContextStateSaver stateSaver(context);
    135138
    136     FloatSize corner(2, 2);
     139    float roundness = (part == SquareButtonPart) ? 0 : 2;
     140
     141    FloatSize corner(roundness, roundness);
    137142    FloatRoundedRect roundedRect(zoomedRect, corner, corner, corner, corner);
    138143    Path path;
  • trunk/Source/WebCore/platform/wpe/ThemeWPE.h

    r231557 r247827  
    3838    void paintCheckbox(ControlStates&, GraphicsContext&, const FloatRect&, float);
    3939    void paintRadio(ControlStates&, GraphicsContext&, const FloatRect&, float);
    40     void paintButton(ControlStates&, GraphicsContext&, const FloatRect&, float);
     40    void paintButton(ControlPart, ControlStates&, GraphicsContext&, const FloatRect&, float);
    4141};
    4242
Note: See TracChangeset for help on using the changeset viewer.