diff --git a/gui/chrome_tabs.py b/gui/chrome_tabs.py index 521ac6168..95d79415d 100644 --- a/gui/chrome_tabs.py +++ b/gui/chrome_tabs.py @@ -552,24 +552,6 @@ class _TabRenderer: bmp, self.left_width + self.padding - bmp.GetWidth() / 2, (height - bmp.GetHeight()) / 2) - text_start = self.left_width + self.padding + bmp.GetWidth() / 2 - else: - text_start = self.left_width - - mdc.SetFont(self.font) - - maxsize = self.tab_width \ - - text_start \ - - self.right_width \ - - self.padding * 4 - color = self.selected_color if self.selected else self.inactive_color - - mdc.SetTextForeground(color_utils.GetSuitable(color, 1)) - - # draw text (with no ellipses) - text = draw.GetPartialText(mdc, self.text, maxsize, "") - tx, ty = mdc.GetTextExtent(text) - mdc.DrawText(text, text_start + self.padding, height / 2 - ty / 2) # draw close button if self.closeable: @@ -596,6 +578,30 @@ class _TabRenderer: bmp = wx.Bitmap(img) self.tab_bitmap = bmp + # We draw the text separately in order to draw it directly on the native DC, rather than a memory one, because + # drawing text on a memory DC draws it blurry on HD/Retina screens + def DrawText(self, dc): + height = self.tab_height + dc.SetFont(self.font) + + if self.tab_img: + text_start = self.left_width + self.padding + self.tab_img.GetWidth() / 2 + else: + text_start = self.left_width + + maxsize = self.tab_width \ + - text_start \ + - self.right_width \ + - self.padding * 4 + color = self.selected_color if self.selected else self.inactive_color + + dc.SetTextForeground(color_utils.GetSuitable(color, 1)) + + # draw text (with no ellipses) + text = draw.GetPartialText(dc, self.text, maxsize, "") + tx, ty = dc.GetTextExtent(text) + dc.DrawText(text, text_start + self.padding, height / 2 - ty / 2) + def __repr__(self): return "_TabRenderer(text={}, disabled={}) at {}".format( self.text, self.disabled, hex(id(self)) @@ -1145,6 +1151,10 @@ class _TabsContainer(wx.Panel): img = img.AdjustChannels(1, 1, 1, 0.85) bmp = wx.Bitmap(img) mdc.DrawBitmap(bmp, posx, posy, True) + + mdc.SetDeviceOrigin(posx, posy) + tab.DrawText(mdc) + mdc.SetDeviceOrigin(0, 0) else: selected = tab @@ -1164,6 +1174,10 @@ class _TabsContainer(wx.Panel): mdc.DrawBitmap(bmp, posx, posy, True) + mdc.SetDeviceOrigin(posx, posy) + selected.DrawText(mdc) + mdc.SetDeviceOrigin(0, 0) + def OnErase(self, event): pass diff --git a/gui/errorDialog.py b/gui/errorDialog.py index 706e3c5a3..d9112d4b8 100644 --- a/gui/errorDialog.py +++ b/gui/errorDialog.py @@ -26,6 +26,7 @@ import traceback import config from logbook import Logger from service.prereqsCheck import version_block +import datetime pyfalog = Logger(__name__) @@ -63,6 +64,11 @@ class ErrorFrame(wx.Frame): wx.Frame.__init__(self, parent, id=wx.ID_ANY, title="pyfa error", pos=wx.DefaultPosition, size=wx.Size(500, 600), style=wx.DEFAULT_FRAME_STYLE ^ wx.RESIZE_BORDER | wx.STAY_ON_TOP) + from eos.config import gamedata_version, gamedata_date + + time = datetime.datetime.fromtimestamp(int(gamedata_date)).strftime('%Y-%m-%d %H:%M:%S') + version = "pyfa v" + config.getVersion() + '\nEVE Data Version: {} ({})\n\n'.format(gamedata_version, time) # gui.aboutData.versionString + desc = "pyfa has experienced an unexpected issue. Below is a message that contains crucial\n" \ "information about how this was triggered. Please contact the developers with the\n" \ "information provided through the EVE Online forums or file a GitHub issue." @@ -97,7 +103,7 @@ class ErrorFrame(wx.Frame): # mainSizer.AddSpacer((0, 5), 0, wx.EXPAND, 5) - self.errorTextCtrl = wx.TextCtrl(self, wx.ID_ANY, version_block.strip(), wx.DefaultPosition, + self.errorTextCtrl = wx.TextCtrl(self, wx.ID_ANY, version + version_block.strip(), wx.DefaultPosition, (-1, 400), wx.TE_MULTILINE | wx.TE_READONLY | wx.TE_RICH2 | wx.TE_DONTWRAP) self.errorTextCtrl.SetFont(wx.Font(8, wx.FONTFAMILY_TELETYPE, wx.NORMAL, wx.NORMAL)) mainSizer.Add(self.errorTextCtrl, 0, wx.EXPAND | wx.ALL | wx.ALIGN_CENTER, 5)