Skip to content

Commit b0899ef

Browse files
sc0wlukefromdc
authored andcommitted
avoid deprecated 'gtk_widget_override_font'
1 parent 347e1f1 commit b0899ef

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

eel/eel-gtk-extensions.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,11 @@ eel_gtk_label_make_bold (GtkLabel *label)
357357
* theme or user prefs, since the font desc only has the
358358
* weight flag turned on.
359359
*/
360-
gtk_widget_override_font (GTK_WIDGET (label), font_desc);
360+
PangoAttrList *attrs = pango_attr_list_new ();
361+
PangoAttribute *font_desc_attr = pango_attr_font_desc_new (font_desc);
362+
pango_attr_list_insert (attrs, font_desc_attr);
363+
gtk_label_set_attributes (label, attrs);
364+
pango_attr_list_unref (attrs);
361365

362366
pango_font_description_free (font_desc);
363367
}

src/caja-sidebar-title.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,13 @@ update_title_font (CajaSidebarTitle *sidebar_title)
478478

479479
pango_font_description_set_size (title_font, max_fit_font_size * PANGO_SCALE);
480480
pango_font_description_set_weight (title_font, PANGO_WEIGHT_BOLD);
481-
gtk_widget_override_font (sidebar_title->details->title_label, title_font);
481+
482+
PangoAttrList *attrs = pango_attr_list_new ();
483+
PangoAttribute *font_desc_attr = pango_attr_font_desc_new (title_font);
484+
pango_attr_list_insert (attrs, font_desc_attr);
485+
gtk_label_set_attributes (GTK_LABEL (sidebar_title->details->title_label), attrs);
486+
pango_attr_list_unref (attrs);
487+
482488
pango_font_description_free (title_font);
483489
}
484490

0 commit comments

Comments
 (0)