for GTK+ 3.6 and later, invalidate cached best size when GTK's style cache is updated, see #16088

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76149 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Paul Cornett
2014-03-15 18:44:02 +00:00
parent f9b4d6b18c
commit d2e4b3520b
4 changed files with 86 additions and 2 deletions

View File

@@ -61,11 +61,13 @@ bool wxControl::Create( wxWindow *parent,
bool wxControl::SetFont(const wxFont& font)
{
const bool changed = base_type::SetFont(font);
if (changed && !gtk_widget_get_realized(m_widget))
if (changed && !gtk_widget_get_realized(m_widget) && gtk_check_version(3,5,0))
{
// GTK defers sending "style-updated" until widget is realized, but
// GetBestSize() won't compute correct result until the signal is sent,
// so we have to do it now
// But don't bother for GTK > 3.4, the change won't take effect until
// GTK updates it's style cache
g_signal_emit_by_name(m_widget, "style-updated");
}
return changed;