diff --git a/graphs/gui/panel.py b/graphs/gui/panel.py index d824a7062..b12baa2da 100644 --- a/graphs/gui/panel.py +++ b/graphs/gui/panel.py @@ -270,15 +270,8 @@ class GraphControlPanel(wx.Panel): self.targetList.refreshExtraColumns(view.tgtExtraCols) self.srcTgtSizer.Detach(self.sourceList) self.srcTgtSizer.Detach(self.targetList) - - def getProportion(wrapperList): - propWidth = 0 - for column in wrapperList.activeColumns: - propWidth += column.proportionWidth - return propWidth - - self.srcTgtSizer.Add(self.sourceList, getProportion(self.sourceList), wx.EXPAND | wx.ALL, 0) - self.srcTgtSizer.Add(self.targetList, getProportion(self.targetList), wx.EXPAND | wx.LEFT, 10) + self.srcTgtSizer.Add(self.sourceList, self.sourceList.getWidthProportion(), wx.EXPAND | wx.ALL, 0) + self.srcTgtSizer.Add(self.targetList, self.targetList.getWidthProportion(), wx.EXPAND | wx.LEFT, 10) self.Layout() def OnShowLegendChange(self, event): diff --git a/gui/display.py b/gui/display.py index 9b588b294..e59597827 100644 --- a/gui/display.py +++ b/gui/display.py @@ -296,3 +296,7 @@ class Display(wx.ListCtrl): rows.append(row) row = self.GetNextSelected(row) return rows + + def getWidthProportion(self): + propWidth = sum(c.proportionWidth for c in self.activeColumns) + return propWidth