Mangled Item/Ship description content to respect current theme

This commit is contained in:
HomeWorld
2010-12-14 20:07:34 +02:00
parent dd67fa1a7e
commit 1ec2902874

View File

@@ -185,11 +185,14 @@ class ItemDescription ( wx.Panel ):
mainSizer = wx.BoxSizer(wx.VERTICAL)
self.SetSizer(mainSizer)
bgcolor = wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW)
fgcolor = wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOWTEXT)
self.description = wx.html.HtmlWindow(self)
desc = item.description.replace("\r","<br>")
desc = re.sub("<( *)font( *)color( *)=(.*)>", "<b>", desc)
desc = re.sub("<( *)/( *)font( *)>","</b>", desc)
desc = "<body bgcolor='" + bgcolor.GetAsString(wx.C2S_HTML_SYNTAX) + "' text='" + fgcolor.GetAsString(wx.C2S_HTML_SYNTAX) + "' >" + desc + "</body>"
self.description.SetPage(desc)