Expand gauges as much as possible

master
Guillaume Seguin 2013-05-17 17:53:05 +02:00
parent dfa474e0b1
commit 7657b37539
2 changed files with 6 additions and 5 deletions

View File

@ -166,10 +166,10 @@ class LeftPane(wx.GridBagSizer):
root.zfeedc.SetForegroundColour("black")
if root.display_gauges:
root.hottgauge = TempGauge(root.panel, size = (200, 24), title = _("Heater:"), maxval = 300)
self.Add(root.hottgauge, pos = (6, 0), span = (1, 6))
root.bedtgauge = TempGauge(root.panel, size = (200, 24), title = _("Bed:"), maxval = 150)
self.Add(root.bedtgauge, pos = (7, 0), span = (1, 6))
root.hottgauge = TempGauge(root.panel, size = (-1, 24), title = _("Heater:"), maxval = 300)
self.Add(root.hottgauge, pos = (6, 0), span = (1, 6), flag = wx.EXPAND)
root.bedtgauge = TempGauge(root.panel, size = (-1, 24), title = _("Bed:"), maxval = 150)
self.Add(root.bedtgauge, pos = (7, 0), span = (1, 6), flag = wx.EXPAND)
def hotendgauge_scroll_setpoint(e):
rot = e.GetWheelRotation()
if rot > 0:

View File

@ -236,7 +236,6 @@ class TempGauge(wx.Panel):
def SetTarget(self, value):
self.setpoint = value
self.recalc()
wx.CallAfter(self.Refresh)
def interpolatedColour(self, val, vmin, vmid, vmax, cmin, cmid, cmax):
@ -252,6 +251,8 @@ class TempGauge(wx.Panel):
return wx.Colour(*map(int, rgb))
def paint(self, ev):
self.width, self.height = self.GetClientSizeTuple()
self.recalc()
x0, y0, x1, y1, xE, yE = 1, 1, self.ypt+1, 1, self.width+1-2, 20
dc = wx.PaintDC(self)
dc.SetBackground(wx.Brush((255, 255, 255)))