From 7657b3753988172b9c9ebd6a0b4e062a7d392dd2 Mon Sep 17 00:00:00 2001 From: Guillaume Seguin Date: Fri, 17 May 2013 17:53:05 +0200 Subject: [PATCH] Expand gauges as much as possible --- printrun/gui.py | 8 ++++---- printrun/pronterface_widgets.py | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/printrun/gui.py b/printrun/gui.py index c44c148..b042c00 100644 --- a/printrun/gui.py +++ b/printrun/gui.py @@ -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: diff --git a/printrun/pronterface_widgets.py b/printrun/pronterface_widgets.py index 8249a55..a40c682 100644 --- a/printrun/pronterface_widgets.py +++ b/printrun/pronterface_widgets.py @@ -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)))