Move proportion width calcuation to display class

This commit is contained in:
DarkPhoenix
2019-08-07 09:24:26 +03:00
parent f52fda3f03
commit 2155aa0d21
2 changed files with 6 additions and 9 deletions

View File

@@ -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):

View File

@@ -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