From 536ebb1bc4e37be539c6b3009b0b7fa1befe43ed Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Sat, 14 May 2016 11:38:56 -0700 Subject: [PATCH] Fix single line wxTextCtrl selection colors when foreground or background color is set with GTK3 see #17527 --- src/gtk/textctrl.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index 8ef85e6f84..e206aa2ecd 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -1823,16 +1823,13 @@ void wxTextCtrl::DoApplyWidgetStyle(GtkRcStyle *style) { GdkRGBA fg_orig, bg_orig; GtkStyleContext* context = gtk_widget_get_style_context(m_text); + gtk_style_context_save(context); if (IsMultiLine()) - { - gtk_style_context_save(context); gtk_style_context_add_class(context, GTK_STYLE_CLASS_VIEW); - } gtk_style_context_set_state(context, selectedFocused); gtk_style_context_get_color(context, selectedFocused, &fg_orig); gtk_style_context_get_background_color(context, selectedFocused, &bg_orig); - if (IsMultiLine()) - gtk_style_context_restore(context); + gtk_style_context_restore(context); if (fg_ok) gtk_widget_override_color(m_text, selectedFocused, &fg_orig);