[Webkit-unassigned] [Bug 50820] [GTK] Port to GtkStyleContext

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Dec 14 02:29:37 PST 2010


https://bugs.webkit.org/show_bug.cgi?id=50820





--- Comment #3 from Carlos Garcia Campos <cgarcia at igalia.com>  2010-12-14 02:29:36 PST ---
Created an attachment (id=76519)
 --> (https://bugs.webkit.org/attachment.cgi?id=76519&action=review)
Port gtk2 code to GtkStyleContext

This second patch is the real port to GtkStyleContext. All gtk3 code is in RenderThemeGtk3 and ScrollbarThemeGtk3, mozilla code is not used anymore in gtk3 which also means we don't need fake widgets either \o/

RenderThemeGtk3: gtk3 provides GtkStyleContext that don't need a real widget to draw, they only need widget paths (GtkWidgetPath). Instead of creating a big struct to cache every style context I'm using a global static HashMap that dynamically stores the style context for every widget type, using the GType (which is an integer) of the widget to render as the hash key. A private static method getStyleContext() allows getting the style context for any widget type. GtkStyleContext has a signal similar to the old style-set of GtkStyle to know when a new style has been set (because the theme has changed, for example), but it only works for style contexts associated to a widget. Now we connect to gtk-theme-name and gtk-color-scheme (properties of GtkSettings) notify signal to invalidate our style contexts and call platformColorsDidChange(). The rest of the file is the specific code needed to render the widgets using GtkStyleContext, it's based on gtk2 implementations and current gt
 k3 code.

ScrollbarThemeGtk3: The style context for the scrollbars is stored in the global HashMap in RenderThemeGtk3, so we use an accessor to get it in the constructor to cache it. When the theme changes, all the style contexts are invalidated in RenderThemeGtk3, and when a GtkStyleContext is invalidated the changed signal is emitted, so here we only need to connect to the changed signal for the scrollbar context to react to theme changes. The rest of the file is the specific code needed to render the scrollbars using GtkStyleContext.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list