[nautilus] editable-label: use gtk_style_context_get() to query standard props
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] editable-label: use gtk_style_context_get() to query standard props
- Date: Mon, 13 Dec 2010 20:27:19 +0000 (UTC)
commit ef8544bec8437502f2f58c7a9e07bc9e1ecf91a4
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Mon Dec 13 21:25:47 2010 +0100
editable-label: use gtk_style_context_get() to query standard props
Also, fix a leak.
eel/eel-editable-label.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/eel/eel-editable-label.c b/eel/eel-editable-label.c
index db4e091..27e06a2 100644
--- a/eel/eel-editable-label.c
+++ b/eel/eel-editable-label.c
@@ -1121,12 +1121,12 @@ get_label_wrap_width (EelEditableLabel *label)
wrap_width, label_wrap_width_free);
}
- 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))
- return wrap_width->width;
+ goto out;
if (wrap_width->font_desc)
pango_font_description_free (wrap_width->font_desc);
@@ -1137,6 +1137,8 @@ get_label_wrap_width (EelEditableLabel *label)
"This long string gives a good enough length for any line to have.");
pango_layout_get_size (layout, &wrap_width->width, NULL);
g_object_unref (layout);
+
+ out:
pango_font_description_free (desc);
return wrap_width->width;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]