From 2c37aade57ad8f253a5766404300e2d6af266e69 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 23 Oct 2001 17:41:51 +0000 Subject: [PATCH] fixed nice bug in wxGTK which always draw the text with the same foreground colour as background one in wxSOLID mode git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12153 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/dcclient.cpp | 5 +++-- src/gtk1/dcclient.cpp | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/gtk/dcclient.cpp b/src/gtk/dcclient.cpp index dd82f8f8b4..f01f370d2e 100644 --- a/src/gtk/dcclient.cpp +++ b/src/gtk/dcclient.cpp @@ -1374,11 +1374,12 @@ void wxWindowDC::DoDrawText( const wxString &text, wxCoord x, wxCoord y ) #else wxCoord width = gdk_string_width( font, text.mbc_str() ); wxCoord height = font->ascent + font->descent; - /* CMB 21/5/98: draw text background if mode is wxSOLID */ - if (m_backgroundMode == wxSOLID) + + if ( m_backgroundMode == wxSOLID ) { gdk_gc_set_foreground( m_textGC, m_textBackgroundColour.GetColor() ); gdk_draw_rectangle( m_window, m_textGC, TRUE, x, y, width, height ); + gdk_gc_set_foreground( m_textGC, m_textForegroundColour.GetColor() ); } gdk_draw_string( m_window, font, m_textGC, x, y + font->ascent, text.mbc_str() ); #endif diff --git a/src/gtk1/dcclient.cpp b/src/gtk1/dcclient.cpp index dd82f8f8b4..f01f370d2e 100644 --- a/src/gtk1/dcclient.cpp +++ b/src/gtk1/dcclient.cpp @@ -1374,11 +1374,12 @@ void wxWindowDC::DoDrawText( const wxString &text, wxCoord x, wxCoord y ) #else wxCoord width = gdk_string_width( font, text.mbc_str() ); wxCoord height = font->ascent + font->descent; - /* CMB 21/5/98: draw text background if mode is wxSOLID */ - if (m_backgroundMode == wxSOLID) + + if ( m_backgroundMode == wxSOLID ) { gdk_gc_set_foreground( m_textGC, m_textBackgroundColour.GetColor() ); gdk_draw_rectangle( m_window, m_textGC, TRUE, x, y, width, height ); + gdk_gc_set_foreground( m_textGC, m_textForegroundColour.GetColor() ); } gdk_draw_string( m_window, font, m_textGC, x, y + font->ascent, text.mbc_str() ); #endif -- 2.47.2