ui: Port to GtkStyleContext

GtkStyle has been deprecated in favor of GtkStyleContext. A full
port would involve replacing GdkColor with GdkRGBA - leave this
out for the time being.

Bump the required version of GTK+.

https://bugzilla.gnome.org/show_bug.cgi?id=637761
This commit is contained in:
Florian Müllner
2010-12-09 14:52:16 +01:00
parent 42fdd4f4d8
commit 565f002bc4
11 changed files with 230 additions and 182 deletions

View File

@ -713,9 +713,9 @@ meta_ui_theme_get_frame_borders (MetaUI *ui,
int *right_width)
{
int text_height;
GtkStyleContext *style = NULL;
PangoContext *context;
const PangoFontDescription *font_desc;
GtkStyle *default_style;
if (meta_ui_have_a_theme ())
{
@ -724,8 +724,8 @@ meta_ui_theme_get_frame_borders (MetaUI *ui,
if (!font_desc)
{
default_style = gtk_widget_get_default_style ();
font_desc = default_style->font_desc;
style = gtk_style_context_new ();
font_desc = gtk_style_context_get_font (style, 0);
}
text_height = meta_pango_font_desc_get_text_height (font_desc, context);
@ -739,6 +739,9 @@ meta_ui_theme_get_frame_borders (MetaUI *ui,
{
*top_height = *bottom_height = *left_width = *right_width = 0;
}
if (style != NULL)
g_object_unref (style);
}
void