Title: [247827] trunk/Source/WebCore
Revision
247827
Author
[email protected]
Date
2019-07-25 11:04:15 -0700 (Thu, 25 Jul 2019)

Log Message

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

Patch by Joshua Watt <[email protected]> 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:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (247826 => 247827)


--- trunk/Source/WebCore/ChangeLog	2019-07-25 17:56:45 UTC (rev 247826)
+++ trunk/Source/WebCore/ChangeLog	2019-07-25 18:04:15 UTC (rev 247827)
@@ -1,3 +1,18 @@
+2019-07-25  Joshua Watt  <[email protected]>
+
+        [WPE] Draw other button types
+        https://bugs.webkit.org/show_bug.cgi?id=199377
+
+        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:
+
 2019-07-25  Said Abou-Hallawa  <[email protected]>
 
         REGRESSION (r244995): Assertion failure when addEventListener to an SVGElement which has an. instance in shadow tree

Modified: trunk/Source/WebCore/platform/wpe/ThemeWPE.cpp (247826 => 247827)


--- trunk/Source/WebCore/platform/wpe/ThemeWPE.cpp	2019-07-25 17:56:45 UTC (rev 247826)
+++ trunk/Source/WebCore/platform/wpe/ThemeWPE.cpp	2019-07-25 18:04:15 UTC (rev 247827)
@@ -67,7 +67,10 @@
         paintRadio(states, context, zoomedRect, zoomFactor);
         break;
     case PushButtonPart:
-        paintButton(states, context, zoomedRect, zoomFactor);
+    case DefaultButtonPart:
+    case ButtonPart:
+    case SquareButtonPart:
+        paintButton(part, states, context, zoomedRect, zoomFactor);
         break;
     default:
         break;
@@ -129,11 +132,13 @@
     }
 }
 
-void ThemeWPE::paintButton(ControlStates& states, GraphicsContext& context, const FloatRect& zoomedRect, float)
+void ThemeWPE::paintButton(ControlPart part, ControlStates& states, GraphicsContext& context, const FloatRect& zoomedRect, float)
 {
     GraphicsContextStateSaver stateSaver(context);
 
-    FloatSize corner(2, 2);
+    float roundness = (part == SquareButtonPart) ? 0 : 2;
+
+    FloatSize corner(roundness, roundness);
     FloatRoundedRect roundedRect(zoomedRect, corner, corner, corner, corner);
     Path path;
     path.addRoundedRect(roundedRect);

Modified: trunk/Source/WebCore/platform/wpe/ThemeWPE.h (247826 => 247827)


--- trunk/Source/WebCore/platform/wpe/ThemeWPE.h	2019-07-25 17:56:45 UTC (rev 247826)
+++ trunk/Source/WebCore/platform/wpe/ThemeWPE.h	2019-07-25 18:04:15 UTC (rev 247827)
@@ -37,7 +37,7 @@
 
     void paintCheckbox(ControlStates&, GraphicsContext&, const FloatRect&, float);
     void paintRadio(ControlStates&, GraphicsContext&, const FloatRect&, float);
-    void paintButton(ControlStates&, GraphicsContext&, const FloatRect&, float);
+    void paintButton(ControlPart, ControlStates&, GraphicsContext&, const FloatRect&, float);
 };
 
 } // namespace WebCore
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to