[nautilus] file-conflict-dialog: don't use override_font
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] file-conflict-dialog: don't use override_font
- Date: Mon, 6 Dec 2010 18:17:25 +0000 (UTC)
commit 52b8185908725ba9842f3d2ce8c29d7b7e3d520f
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Mon Dec 6 19:16:22 2010 +0100
file-conflict-dialog: don't use override_font
Set the PangoAttributeList on the GtkLabel instead.
.../nautilus-file-conflict-dialog.c | 24 +++++++------------
1 files changed, 9 insertions(+), 15 deletions(-)
---
diff --git a/libnautilus-private/nautilus-file-conflict-dialog.c b/libnautilus-private/nautilus-file-conflict-dialog.c
index 53bf505..2c1b363 100644
--- a/libnautilus-private/nautilus-file-conflict-dialog.c
+++ b/libnautilus-private/nautilus-file-conflict-dialog.c
@@ -110,8 +110,7 @@ file_list_ready_cb (GList *files,
GdkPixbuf *pixbuf;
GtkWidget *label;
GString *str;
- PangoFontDescription *desc, *old_desc;
- GtkStyleContext *style;
+ PangoAttrList *attr_list;
dialog = GTK_DIALOG (fcd);
details = fcd->details;
@@ -203,19 +202,14 @@ file_list_ready_cb (GList *files,
gtk_box_pack_start (GTK_BOX (details->titles_vbox),
label, FALSE, FALSE, 0);
- style = gtk_widget_get_style_context (label);
- gtk_style_context_get_style (style,
- GTK_STYLE_PROPERTY_FONT, &old_desc,
- NULL);
-
- desc = pango_font_description_new ();
- pango_font_description_set_weight (desc, PANGO_WEIGHT_BOLD);
- pango_font_description_set_size (desc,
- pango_font_description_get_size (old_desc) * PANGO_SCALE_LARGE);
- gtk_widget_override_font (label, desc);
- pango_font_description_free (desc);
- pango_font_description_free (old_desc);
- gtk_widget_show (label);
+ attr_list = pango_attr_list_new ();
+ pango_attr_list_insert (attr_list, pango_attr_weight_new (PANGO_WEIGHT_BOLD));
+ pango_attr_list_insert (attr_list, pango_attr_scale_new (PANGO_SCALE_LARGE));
+ g_object_set (label,
+ "attributes", attr_list,
+ NULL);
+
+ pango_attr_list_unref (attr_list);
label = gtk_label_new (secondary_text);
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]