mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-17 09:42:38 +03:00
cope with deprication of gtk_style_context_get_font
This commit is contained in:
parent
b9b952cddf
commit
ab997398ad
@ -173,7 +173,7 @@ void nsgtk_entry_set_icon_from_stock(GtkWidget *entry,
|
||||
const gchar *id)
|
||||
{
|
||||
#if GTK_CHECK_VERSION(3,10,0)
|
||||
gtk_entry_set_icon_from_icon_name(entry, icon_pos, id);
|
||||
gtk_entry_set_icon_from_icon_name(GTK_ENTRY(entry), icon_pos, id);
|
||||
#else
|
||||
#if GTK_CHECK_VERSION(2,16,0)
|
||||
gtk_entry_set_icon_from_stock(GTK_ENTRY(entry), icon_pos, id);
|
||||
@ -315,11 +315,17 @@ GtkStyleContext *nsgtk_widget_get_style_context(GtkWidget *widget)
|
||||
const PangoFontDescription* nsgtk_style_context_get_font(GtkStyleContext *style,
|
||||
GtkStateFlags state)
|
||||
{
|
||||
#if GTK_CHECK_VERSION(3,8,0)
|
||||
const PangoFontDescription* fontdesc;
|
||||
gtk_style_context_get(style, state, GTK_STYLE_PROPERTY_FONT, &fontdesc, NULL);
|
||||
return fontdesc;
|
||||
#else
|
||||
#if GTK_CHECK_VERSION(3,0,0)
|
||||
return gtk_style_context_get_font(style, state);
|
||||
#else
|
||||
return style->font_desc;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
gulong nsgtk_connect_draw_event(GtkWidget *widget,
|
||||
|
@ -113,6 +113,12 @@ enum {
|
||||
|
||||
GtkWidget *nsgtk_entry_new(void);
|
||||
void nsgtk_entry_set_icon_from_pixbuf(GtkWidget *entry, GtkEntryIconPosition icon_pos, GdkPixbuf *pixbuf);
|
||||
|
||||
/**
|
||||
* Sets the icon shown in the entry at the specified position from a stock image.
|
||||
*
|
||||
* Compatability interface for interface deprecated in 3.10
|
||||
*/
|
||||
void nsgtk_entry_set_icon_from_stock(GtkWidget *entry, GtkEntryIconPosition icon_pos, const gchar *stock_id);
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user