Fix a bug where hard size settings in displays weren't respected

This commit is contained in:
cncfanatics
2010-10-20 15:00:59 +02:00
parent abf37afbbc
commit c667ecbe36

View File

@@ -141,12 +141,15 @@ class Display(wx.ListCtrl):
for i, col in enumerate(self.activeColumns):
if not col.resized:
self.SetColumnWidth(i, wx.LIST_AUTOSIZE_USEHEADER)
headerWidth = self.GetColumnWidth(i)
self.SetColumnWidth(i, col.size)
baseWidth = self.GetColumnWidth(i)
if baseWidth < headerWidth:
self.SetColumnWidth(i, headerWidth)
if col.size == wx.LIST_AUTOSIZE:
self.SetColumnWidth(i, wx.LIST_AUTOSIZE_USEHEADER)
headerWidth = self.GetColumnWidth(i)
self.SetColumnWidth(i, wx.LIST_AUTOSIZE)
baseWidth = self.GetColumnWidth(i)
if baseWidth < headerWidth:
self.SetColumnWidth(i, headerWidth)
else:
self.SetColumnWidth(i, col.size)
for sel in selection:
self.Select(sel)