summaryrefslogtreecommitdiff
path: root/eel
diff options
context:
space:
mode:
authorWolfgang Ulbrich <[email protected]>2016-01-07 23:49:26 +0100
committerWolfgang Ulbrich <[email protected]>2016-01-13 15:05:41 +0100
commitc8c302522c9692e616611def4594c8f7364e79d2 (patch)
tree16279d32220971fc764410a95d78c3d0ffd9efc7 /eel
parent34031cbce020b242d523258e06565c6a00c54e5d (diff)
downloadcaja-c8c302522c9692e616611def4594c8f7364e79d2.tar.bz2
caja-c8c302522c9692e616611def4594c8f7364e79d2.tar.xz
GTK3 editable-label: use gtk_style_context_get() to query standard props
Also, fix a leak. taken from: https://git.gnome.org/browse/nautilus/commit/?h=gnome-3-0&id=ef8544b
Diffstat (limited to 'eel')
-rw-r--r--eel/eel-editable-label.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/eel/eel-editable-label.c b/eel/eel-editable-label.c
index 3e138305..0c127525 100644
--- a/eel/eel-editable-label.c
+++ b/eel/eel-editable-label.c
@@ -1169,15 +1169,16 @@ get_label_wrap_width (EelEditableLabel *label)
}
#if GTK_CHECK_VERSION(3,0,0)
- gtk_style_context_get_style (style,
- GTK_STYLE_PROPERTY_FONT, &desc,
- NULL);
+ gtk_style_context_get (style, gtk_widget_get_state_flags (GTK_WIDGET (label)),
+ GTK_STYLE_PROPERTY_FONT, &desc,
+ NULL);
if (wrap_width->font_desc && pango_font_description_equal (wrap_width->font_desc, desc))
+ goto out;
#else
if (wrap_width->font_desc && pango_font_description_equal (wrap_width->font_desc, style->font_desc))
-#endif
return wrap_width->width;
+#endif
if (wrap_width->font_desc)
pango_font_description_free (wrap_width->font_desc);
@@ -1193,6 +1194,8 @@ get_label_wrap_width (EelEditableLabel *label)
pango_layout_get_size (layout, &wrap_width->width, NULL);
g_object_unref (layout);
#if GTK_CHECK_VERSION(3,0,0)
+
+ out:
pango_font_description_free (desc);
#endif