Fix wxTextCtrl::GetStyle() with GTK+ 3

The text and background colours are now stored in the rgba array instead
of fg_color and bg_color as with GTK+ 2 (the latter ones seem to have
been repurposed for the underline and strike-through colours!).

Also make the unit test for this method more robust.
This commit is contained in:
Vadim Zeitlin
2017-11-07 15:40:29 +01:00
parent 5fb740fed8
commit 66324470f1
3 changed files with 17 additions and 10 deletions

View File

@@ -1777,8 +1777,13 @@ bool wxTextCtrl::GetStyle(long position, wxTextAttr& style)
}
else // have custom attributes
{
#ifdef __WXGTK3__
style.SetBackgroundColour(*pattr->appearance.rgba[0]);
style.SetTextColour(*pattr->appearance.rgba[1]);
#else
style.SetBackgroundColour(pattr->appearance.bg_color);
style.SetTextColour(pattr->appearance.fg_color);
#endif
const wxGtkString
pangoFontString(pango_font_description_to_string(pattr->font));