X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/63f06c22b993b8ead320680ffa586d7c0b12ff2e..d21d2e5adf7a5acf3b496a9c4e87eab220bd75d8:/src/univ/themes/gtk.cpp diff --git a/src/univ/themes/gtk.cpp b/src/univ/themes/gtk.cpp index ce8692df8d..39a0ba958e 100644 --- a/src/univ/themes/gtk.cpp +++ b/src/univ/themes/gtk.cpp @@ -54,7 +54,7 @@ // constants (to be removed, for testing only) // ---------------------------------------------------------------------------- -static const wxCoord BORDER_THICKNESS = 1; +static const size_t BORDER_THICKNESS = 1; // ---------------------------------------------------------------------------- // wxGTKRenderer: draw the GUI elements in GTK style @@ -549,9 +549,9 @@ public: wxGTKTheme(); virtual ~wxGTKTheme(); - virtual wxRenderer *GetRenderer() { return m_renderer; } + virtual wxRenderer *GetRenderer(); virtual wxInputHandler *GetInputHandler(const wxString& control); - virtual wxColourScheme *GetColourScheme() { return m_scheme; } + virtual wxColourScheme *GetColourScheme(); private: // get the default input handler @@ -583,8 +583,8 @@ WX_IMPLEMENT_THEME(wxGTKTheme, gtk, wxTRANSLATE("GTK+ theme")); wxGTKTheme::wxGTKTheme() { - m_scheme = new wxGTKColourScheme; - m_renderer = new wxGTKRenderer(m_scheme); + m_scheme = NULL; + m_renderer = NULL; m_handlerDefault = NULL; } @@ -602,6 +602,25 @@ wxGTKTheme::~wxGTKTheme() delete m_scheme; } +wxRenderer *wxGTKTheme::GetRenderer() +{ + if ( !m_renderer ) + { + m_renderer = new wxGTKRenderer(GetColourScheme()); + } + + return m_renderer; +} + +wxColourScheme *wxGTKTheme::GetColourScheme() +{ + if ( !m_scheme ) + { + m_scheme = new wxGTKColourScheme; + } + return m_scheme; +} + wxInputHandler *wxGTKTheme::GetDefaultInputHandler() { if ( !m_handlerDefault ) @@ -1547,7 +1566,7 @@ wxRect wxGTKRenderer::GetTextClientArea(const wxTextCtrl *text, wxCoord *extraSpaceBeyond) { wxRect rectText = rect; - rectText.Inflate(-2*BORDER_THICKNESS); + rectText.Deflate(2*BORDER_THICKNESS); if ( text->WrapLines() ) { @@ -2376,7 +2395,7 @@ void wxGTKRenderer::AdjustSize(wxSize *size, const wxWindow *window) size->y += 4; } } else -#endif wxUSE_BUTTON +#endif //wxUSE_BUTTON if ( wxDynamicCast(window, wxScrollBar) ) { // we only set the width of vert scrollbars and height of the