RESOLVED FIXED Bug 51830
[GTK] Use GtkStyleContext to get platform colors
https://bugs.webkit.org/show_bug.cgi?id=51830
Summary [GTK] Use GtkStyleContext to get platform colors
Carlos Garcia Campos
Reported 2011-01-03 10:29:00 PST
This depends on bug #51764 since the patch for stock icons contains the initial GtkStyleContext port
Attachments
Use GtkStyleContext API to get platform colors (4.84 KB, patch)
2011-01-03 10:32 PST, Carlos Garcia Campos
mrobinson: review-
Updated patch (6.91 KB, patch)
2011-01-04 01:54 PST, Carlos Garcia Campos
no flags
Carlos Garcia Campos
Comment 1 2011-01-03 10:32:57 PST
Created attachment 77821 [details] Use GtkStyleContext API to get platform colors
Martin Robinson
Comment 2 2011-01-03 15:21:39 PST
Comment on attachment 77821 [details] Use GtkStyleContext API to get platform colors View in context: https://bugs.webkit.org/attachment.cgi?id=77821&action=review Looks great. I have one suggested improvement below. > WebCore/platform/gtk/RenderThemeGtk3.cpp:716 > +static Color getStyleColor(GType widgetType, bool background, GtkStateFlags flags) It think it's okay to use a bool here since this helper is so localized, but using an enum as an argument type is generally preferred. > WebCore/platform/gtk/RenderThemeGtk3.cpp:731 > + gdkColor.pixel = 0; > + gdkColor.red = (guint16) (gdkRGBAColor.red * 65535); > + gdkColor.green = (guint16) (gdkRGBAColor.green * 65535); > + gdkColor.blue = (guint16) (gdkRGBAColor.blue * 65535); > + I think it makes sense to create a WebCore color here directly instead of relying on a GdkColor intermediary. Perhaps this could just be: return Color(gdkRGBAColor.red, gdkRGBAColor.green, gdkRGBAColor.blue, gdkRGBAColor.alpha); I could even see adding a specialized constructor in Color.h and Color.cpp for GDK 3.x's GdkRGBA.
Carlos Garcia Campos
Comment 3 2011-01-04 01:54:41 PST
Created attachment 77870 [details] Updated patch I've added Color constructor for GdkRGBA which simplifies everything, thanks Martin :-)
Martin Robinson
Comment 4 2011-01-04 10:28:52 PST
Comment on attachment 77870 [details] Updated patch Very nice!
Carlos Garcia Campos
Comment 5 2011-01-05 02:45:25 PST
Note You need to log in before you can comment on or make changes to this bug.