From: Julian Smart Date: Wed, 12 Jun 2013 09:51:32 +0000 (+0000) Subject: The style listbox now takes into account the style background colour if specified. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/8836dcaadd361ce741a18fed2d8578b79c22b620 The style listbox now takes into account the style background colour if specified. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74179 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/richtext/richtextstyles.cpp b/src/richtext/richtextstyles.cpp index 3cfec1ff07..da733e121e 100644 --- a/src/richtext/richtextstyles.cpp +++ b/src/richtext/richtextstyles.cpp @@ -740,11 +740,20 @@ wxString wxRichTextStyleListBox::CreateHTML(wxRichTextStyleDefinition* def) cons if (attr.HasAlignment() && attr.GetAlignment() == wxTEXT_ALIGNMENT_CENTRE) isCentred = true; + str << wxT(""); + str << wxT(""); + if (isCentred) str << wxT("
"); + str << wxT(""); + str << wxT(">"); if (attr.GetLeftIndent() > 0) { @@ -837,6 +846,9 @@ wxString wxRichTextStyleListBox::CreateHTML(wxRichTextStyleDefinition* def) cons if (attr.GetTextColour().IsOk()) str << wxT(" color=\"#") << ColourToHexString(attr.GetTextColour()) << wxT("\""); + if (attr.GetBackgroundColour().Ok()) + str << wxT(" bgcolor=\"#") << ColourToHexString(attr.GetBackgroundColour()) << wxT("\""); + str << wxT(">"); bool hasBold = false; @@ -876,6 +888,7 @@ wxString wxRichTextStyleListBox::CreateHTML(wxRichTextStyleDefinition* def) cons if (isCentred) str << wxT("
"); + str << wxT(""); return str; }