diff options
Diffstat (limited to 'libcaja-private/caja-file-conflict-dialog.c')
-rw-r--r-- | libcaja-private/caja-file-conflict-dialog.c | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/libcaja-private/caja-file-conflict-dialog.c b/libcaja-private/caja-file-conflict-dialog.c index 28887f88..300543b3 100644 --- a/libcaja-private/caja-file-conflict-dialog.c +++ b/libcaja-private/caja-file-conflict-dialog.c @@ -116,8 +116,7 @@ file_list_ready_cb (GList *files, GtkWidget *label; GString *str; #if GTK_CHECK_VERSION(3,0,0) - PangoFontDescription *desc, *old_desc; - GtkStyleContext *style; + PangoAttrList *attr_list; #else PangoFontDescription *desc; #endif @@ -221,25 +220,22 @@ file_list_ready_cb (GList *files, label = gtk_label_new (primary_text); gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); gtk_label_set_line_wrap_mode (GTK_LABEL (label), PANGO_WRAP_WORD_CHAR); - gtk_widget_set_size_request (label, 350, -1); -#if GTK_CHECK_VERSION (3, 14, 0) +#if GTK_CHECK_VERSION (3, 0, 0) gtk_widget_set_halign (label, GTK_ALIGN_START); gtk_box_pack_start (GTK_BOX (details->titles_vbox), label, FALSE, FALSE, 0); + gtk_widget_show (label); - style = gtk_widget_get_style_context (label); - gtk_style_context_get_style (style, - GTK_STYLE_PROPERTY_FONT, &old_desc, - NULL); + 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); - 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); + pango_attr_list_unref (attr_list); #else + gtk_widget_set_size_request (label, 350, -1); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_box_pack_start (GTK_BOX (details->titles_vbox), label, FALSE, FALSE, 0); @@ -252,15 +248,15 @@ file_list_ready_cb (GList *files, pango_font_description_get_size (gtk_widget_get_style (label)->font_desc) * PANGO_SCALE_LARGE); gtk_widget_modify_font (label, desc); pango_font_description_free (desc); -#endif gtk_widget_show (label); +#endif label = gtk_label_new (secondary_text); gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); - gtk_widget_set_size_request (label, 350, -1); -#if GTK_CHECK_VERSION (3, 14, 0) +#if GTK_CHECK_VERSION (3, 0, 0) gtk_widget_set_halign (label, GTK_ALIGN_START); #else + gtk_widget_set_size_request (label, 350, -1); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); #endif gtk_box_pack_start (GTK_BOX (details->titles_vbox), |