Fix single line wxTextCtrl selection colors when foreground or background color is set with GTK3
see #17527
This commit is contained in:
@@ -1823,16 +1823,13 @@ void wxTextCtrl::DoApplyWidgetStyle(GtkRcStyle *style)
|
|||||||
{
|
{
|
||||||
GdkRGBA fg_orig, bg_orig;
|
GdkRGBA fg_orig, bg_orig;
|
||||||
GtkStyleContext* context = gtk_widget_get_style_context(m_text);
|
GtkStyleContext* context = gtk_widget_get_style_context(m_text);
|
||||||
|
gtk_style_context_save(context);
|
||||||
if (IsMultiLine())
|
if (IsMultiLine())
|
||||||
{
|
|
||||||
gtk_style_context_save(context);
|
|
||||||
gtk_style_context_add_class(context, GTK_STYLE_CLASS_VIEW);
|
gtk_style_context_add_class(context, GTK_STYLE_CLASS_VIEW);
|
||||||
}
|
|
||||||
gtk_style_context_set_state(context, selectedFocused);
|
gtk_style_context_set_state(context, selectedFocused);
|
||||||
gtk_style_context_get_color(context, selectedFocused, &fg_orig);
|
gtk_style_context_get_color(context, selectedFocused, &fg_orig);
|
||||||
gtk_style_context_get_background_color(context, selectedFocused, &bg_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)
|
if (fg_ok)
|
||||||
gtk_widget_override_color(m_text, selectedFocused, &fg_orig);
|
gtk_widget_override_color(m_text, selectedFocused, &fg_orig);
|
||||||
|
Reference in New Issue
Block a user