Commit 7657b375 authored by Guillaume Seguin's avatar Guillaume Seguin

Expand gauges as much as possible

parent dfa474e0
...@@ -166,10 +166,10 @@ class LeftPane(wx.GridBagSizer): ...@@ -166,10 +166,10 @@ class LeftPane(wx.GridBagSizer):
root.zfeedc.SetForegroundColour("black") root.zfeedc.SetForegroundColour("black")
if root.display_gauges: if root.display_gauges:
root.hottgauge = TempGauge(root.panel, size = (200, 24), title = _("Heater:"), maxval = 300) root.hottgauge = TempGauge(root.panel, size = (-1, 24), title = _("Heater:"), maxval = 300)
self.Add(root.hottgauge, pos = (6, 0), span = (1, 6)) self.Add(root.hottgauge, pos = (6, 0), span = (1, 6), flag = wx.EXPAND)
root.bedtgauge = TempGauge(root.panel, size = (200, 24), title = _("Bed:"), maxval = 150) root.bedtgauge = TempGauge(root.panel, size = (-1, 24), title = _("Bed:"), maxval = 150)
self.Add(root.bedtgauge, pos = (7, 0), span = (1, 6)) self.Add(root.bedtgauge, pos = (7, 0), span = (1, 6), flag = wx.EXPAND)
def hotendgauge_scroll_setpoint(e): def hotendgauge_scroll_setpoint(e):
rot = e.GetWheelRotation() rot = e.GetWheelRotation()
if rot > 0: if rot > 0:
......
...@@ -236,7 +236,6 @@ class TempGauge(wx.Panel): ...@@ -236,7 +236,6 @@ class TempGauge(wx.Panel):
def SetTarget(self, value): def SetTarget(self, value):
self.setpoint = value self.setpoint = value
self.recalc()
wx.CallAfter(self.Refresh) wx.CallAfter(self.Refresh)
def interpolatedColour(self, val, vmin, vmid, vmax, cmin, cmid, cmax): def interpolatedColour(self, val, vmin, vmid, vmax, cmin, cmid, cmax):
...@@ -252,6 +251,8 @@ class TempGauge(wx.Panel): ...@@ -252,6 +251,8 @@ class TempGauge(wx.Panel):
return wx.Colour(*map(int, rgb)) return wx.Colour(*map(int, rgb))
def paint(self, ev): 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 x0, y0, x1, y1, xE, yE = 1, 1, self.ypt+1, 1, self.width+1-2, 20
dc = wx.PaintDC(self) dc = wx.PaintDC(self)
dc.SetBackground(wx.Brush((255, 255, 255))) dc.SetBackground(wx.Brush((255, 255, 255)))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment