X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ec376c8fd9ff813392030426acd2317c6fa6527e..2e61f6814126617f286fad69f614cccd86db6412:/src/gtk/fontpicker.cpp diff --git a/src/gtk/fontpicker.cpp b/src/gtk/fontpicker.cpp index 8934897134..97102051c8 100644 --- a/src/gtk/fontpicker.cpp +++ b/src/gtk/fontpicker.cpp @@ -17,23 +17,17 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#include "wx/gtk/private.h" +#if wxUSE_FONTPICKERCTRL && defined(__WXGTK24__) + #include "wx/fontpicker.h" #include "wx/fontutil.h" // for wxNativeFontInfo #include "wx/gtk/private.h" -#include -#include - - - // ============================================================================ // implementation // ============================================================================ -#if wxUSE_FONTPICKERCTRL && defined(__WXGTK24__) - //----------------------------------------------------------------------------- // "font-set" //----------------------------------------------------------------------------- @@ -78,7 +72,7 @@ bool wxFontButton::Create( wxWindow *parent, wxWindowID id, m_widget = gtk_font_button_new(); // set initial font - m_selectedFont = initial; + m_selectedFont = initial.IsOk() ? initial : *wxNORMAL_FONT; UpdateFont(); // honour the fontbutton styles @@ -100,7 +94,7 @@ bool wxFontButton::Create( wxWindow *parent, wxWindowID id, m_parent->DoAddChild( this ); PostCreation(size); - SetBestSize(size); + SetInitialSize(size); } else return wxGenericFontButton::Create(parent, id, initial, pos, size, @@ -126,4 +120,4 @@ void wxFontButton::UpdateFont() wxGenericFontButton::UpdateFont(); } -#endif // wxUSE_FONTPICKERCTRL +#endif // wxUSE_FONTPICKERCTRL && defined(__WXGTK24__)