avoid deprecated gtk_style_context_get_font(), closes #15697
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75284 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -254,9 +254,9 @@ wxControl::GetDefaultAttributesFromGTKWidget(GtkWidget* widget,
|
|||||||
gtk_style_context_get_background_color(sc, stateFlag, &c);
|
gtk_style_context_get_background_color(sc, stateFlag, &c);
|
||||||
attr.colBg = wxColour(c);
|
attr.colBg = wxColour(c);
|
||||||
wxNativeFontInfo info;
|
wxNativeFontInfo info;
|
||||||
info.description = const_cast<PangoFontDescription*>(gtk_style_context_get_font(sc, stateFlag));
|
gtk_style_context_get(
|
||||||
|
sc, stateFlag, GTK_STYLE_PROPERTY_FONT, &info.description, NULL);
|
||||||
attr.font = wxFont(info);
|
attr.font = wxFont(info);
|
||||||
info.description = NULL;
|
|
||||||
#else
|
#else
|
||||||
GtkStyle* style;
|
GtkStyle* style;
|
||||||
|
|
||||||
|
@@ -428,8 +428,8 @@ wxFont wxSystemSettingsNative::GetFont( wxSystemFont index )
|
|||||||
wxNativeFontInfo info;
|
wxNativeFontInfo info;
|
||||||
#ifdef __WXGTK3__
|
#ifdef __WXGTK3__
|
||||||
GtkStyleContext* sc = gtk_widget_get_style_context(ButtonWidget());
|
GtkStyleContext* sc = gtk_widget_get_style_context(ButtonWidget());
|
||||||
info.description = const_cast<PangoFontDescription*>(
|
gtk_style_context_get(sc, GTK_STATE_FLAG_NORMAL,
|
||||||
gtk_style_context_get_font(sc, GTK_STATE_FLAG_NORMAL));
|
GTK_STYLE_PROPERTY_FONT, &info.description, NULL);
|
||||||
#else
|
#else
|
||||||
info.description = ButtonStyle()->font_desc;
|
info.description = ButtonStyle()->font_desc;
|
||||||
#endif
|
#endif
|
||||||
@@ -440,10 +440,14 @@ wxFont wxSystemSettingsNative::GetFont( wxSystemFont index )
|
|||||||
// it's "Sans Serif" but the real font is called "Sans"):
|
// it's "Sans Serif" but the real font is called "Sans"):
|
||||||
if (!wxFontEnumerator::IsValidFacename(gs_fontSystem.GetFaceName()) &&
|
if (!wxFontEnumerator::IsValidFacename(gs_fontSystem.GetFaceName()) &&
|
||||||
gs_fontSystem.GetFaceName() == "Sans Serif")
|
gs_fontSystem.GetFaceName() == "Sans Serif")
|
||||||
|
{
|
||||||
gs_fontSystem.SetFaceName("Sans");
|
gs_fontSystem.SetFaceName("Sans");
|
||||||
|
}
|
||||||
#endif // wxUSE_FONTENUM
|
#endif // wxUSE_FONTENUM
|
||||||
|
|
||||||
|
#ifndef __WXGTK3__
|
||||||
info.description = NULL;
|
info.description = NULL;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
font = gs_fontSystem;
|
font = gs_fontSystem;
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user