[GTK] Menulist buttons have separators even when the theme turns them off
authormrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Mar 2012 22:04:50 +0000 (22:04 +0000)
committermrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Mar 2012 22:04:50 +0000 (22:04 +0000)
https://bugs.webkit.org/show_bug.cgi?id=80668

Reviewed by Daniel Bates.

No new tests. GTK+ theme differences are notoriously difficult
to test, because consistent results depend on having certain themes
and certain versions of themes installed.

Instead of using the GTK_TYPE_BUTTON and GTK_TYPE_SEPARATOR tags to get the
style context, use GTK_TYPE_COMBO_BOX which should provide more accurate theme settings.

* platform/gtk/RenderThemeGtk3.cpp:
(WebCore::getComboBoxMetrics): Get metrics from a GTK_TYPE_COMBO_BOX style context.
(WebCore::RenderThemeGtk::paintMenuList): Get separator settings from the GTK_TYPE_COMBO_BOX style context.

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

Source/WebCore/ChangeLog
Source/WebCore/platform/gtk/RenderThemeGtk3.cpp

index 919f79a..fc8eda4 100644 (file)
@@ -1,3 +1,21 @@
+2012-03-12  Martin Robinson  <mrobinson@igalia.com>
+
+        [GTK] Menulist buttons have separators even when the theme turns them off
+        https://bugs.webkit.org/show_bug.cgi?id=80668
+
+        Reviewed by Daniel Bates.
+
+        No new tests. GTK+ theme differences are notoriously difficult
+        to test, because consistent results depend on having certain themes
+        and certain versions of themes installed.
+
+        Instead of using the GTK_TYPE_BUTTON and GTK_TYPE_SEPARATOR tags to get the
+        style context, use GTK_TYPE_COMBO_BOX which should provide more accurate theme settings.
+
+        * platform/gtk/RenderThemeGtk3.cpp:
+        (WebCore::getComboBoxMetrics): Get metrics from a GTK_TYPE_COMBO_BOX style context.
+        (WebCore::RenderThemeGtk::paintMenuList): Get separator settings from the GTK_TYPE_COMBO_BOX style context.
+
 2012-03-14  Levi Weintraub  <leviw@chromium.org>
 
         Implement proper sub-pixel support in RenderFileUploadControl
index 3563002..a669bc8 100644 (file)
@@ -366,7 +366,7 @@ static void getComboBoxMetrics(RenderStyle* style, GtkBorder& border, int& focus
     if (style->appearance() == NoControlPart)
         return;
 
-    GtkStyleContext* context = getStyleContext(GTK_TYPE_BUTTON);
+    GtkStyleContext* context = getStyleContext(GTK_TYPE_COMBO_BOX);
     gtk_style_context_save(context);
 
     gtk_style_context_add_class(context, GTK_STYLE_CLASS_BUTTON);
@@ -522,12 +522,11 @@ bool RenderThemeGtk::paintMenuList(RenderObject* renderObject, const PaintInfo&
     gtk_style_context_restore(arrowStyleContext);
 
     // Paint the separator if needed.
-    GtkStyleContext* separatorStyleContext = getStyleContext(GTK_TYPE_SEPARATOR);
+    GtkStyleContext* separatorStyleContext = getStyleContext(GTK_TYPE_COMBO_BOX);
     gtk_style_context_save(separatorStyleContext);
 
     gtk_style_context_set_direction(separatorStyleContext, direction);
     gtk_style_context_add_class(separatorStyleContext, "separator");
-    gtk_style_context_add_class(separatorStyleContext, GTK_STYLE_CLASS_BUTTON);
 
     gboolean wideSeparators;
     gint separatorWidth;