From 6ac2e677ae3d96c63c91bbdfbb6043dd79ef8cb5 Mon Sep 17 00:00:00 2001 From: HomeWorld Date: Sat, 28 Aug 2010 18:56:20 +0300 Subject: [PATCH] Text align fix + removal of early polish applied to statspane gauges --- gui/pygauge.py | 10 +++++----- gui/statsPane.py | 7 ++----- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/gui/pygauge.py b/gui/pygauge.py index a17d2e768..9f7260649 100644 --- a/gui/pygauge.py +++ b/gui/pygauge.py @@ -264,14 +264,14 @@ class PyGauge(wx.PyWindow): dc.DrawRectangleRect(r) dc.SetTextForeground(wx.Colour(255,255,255)) - font1 = wx.Font(7, wx.SWISS, wx.NORMAL, wx.NORMAL) + font1 = wx.Font(9, wx.MODERN, wx.NORMAL, wx.NORMAL) dc.SetFont(font1) if self._skipDigits == True: - textWidth=len(str(int(self._value[0]*100/self._range)) + "%") * 7 - dc.DrawText(str(int(self._value[0]*100/self._range)) + "%",rect.width/2-textWidth/2,(rect.height-8)/2) + textWidth=len(str(int(self._value[0]*100/self._range)) + "%") * 9 + dc.DrawText(str(int(self._value[0]*100/self._range)) + "%",(rect.width-2)/2 - textWidth/4,(rect.height-11)/2) else: - textWidth=len(str(round(float(self._value[0]*100/self._range),1))+ "%") * 7 - dc.DrawText(str(round(float(self._value[0]*100/self._range),1)) + "%",rect.width/2-textWidth/2,(rect.height-8)/2) + textWidth=len(str(round(float(self._value[0]*100/self._range),1))+ "%")*9 + dc.DrawText(str(round(float(self._value[0]*100/self._range),1)) + "%",(rect.width-2)/2-textWidth/4,(rect.height-11)/2) def OnTimer(self,event): """ diff --git a/gui/statsPane.py b/gui/statsPane.py index 5da1285a7..33e8f7862 100644 --- a/gui/statsPane.py +++ b/gui/statsPane.py @@ -104,7 +104,7 @@ class StatsPane(wx.Panel): if self._showNormalGauges == True: lbl.SetLabel("%.2f" % resonance) else: - lbl.Update(resonance-lbl.GetValue(),250) + lbl.SetValue(resonance) ehp = fit.ehp if fit is not None else None for tankType in ("shield", "armor", "hull"): @@ -278,8 +278,6 @@ class StatsPane(wx.Panel): gauge = PG.PyGauge(parent, wx.ID_ANY, 100) gauge.SetMinSize((80, 16)) gauge.SetSkipDigitsFlag(True) - gauge.SetValue(100) - gauge.Update(-100,250) setattr(self, "gauge%s" % capitalizedType, gauge) stats.Add(gauge, 0, wx.ALIGN_CENTER) @@ -345,9 +343,8 @@ class StatsPane(wx.Panel): lbl.SetBackgroundColour(wx.Colour(bc[0],bc[1],bc[2])) lbl.SetBarColour(wx.Colour(fc[0],fc[1],fc[2])) lbl.SetBarGradient() - lbl.SetValue(100) lbl.SetSkipDigitsFlag(False) - lbl.Update(-100,250) + setattr(self, "labelResistance%s%s" % (tankType.capitalize(), damageType.capitalize()), lbl) box.Add(lbl, 0, wx.ALIGN_CENTER)