Call layout when frame is created as well

This commit is contained in:
DarkPhoenix
2019-06-26 07:59:18 +03:00
parent 9f261f5b80
commit 15a8c5750a
2 changed files with 9 additions and 5 deletions

View File

@@ -113,7 +113,7 @@ class GraphFrame(wx.Frame):
for view in Graph.views:
self.graphSelection.Append(view.name, view())
self.graphSelection.SetSelection(0)
self.ctrlPanel.updateControls()
self.ctrlPanel.updateControls(layout=False)
# Event bindings - local events
self.Bind(wx.EVT_CLOSE, self.closeEvent)
@@ -123,8 +123,9 @@ class GraphFrame(wx.Frame):
from gui.builtinStatsViews.resistancesViewFull import EFFECTIVE_HP_TOGGLED # Grr crclar gons
self.mainFrame.Bind(EFFECTIVE_HP_TOGGLED, self.OnEhpToggled)
self.draw()
self.Layout()
self.UpdateWindowSize()
self.draw()
def UpdateWindowSize(self):
curW, curH = self.GetSize()

View File

@@ -97,7 +97,7 @@ class GraphControlPanel(wx.Panel):
self.drawTimer = wx.Timer(self)
self.Bind(wx.EVT_TIMER, self.OnDrawTimer, self.drawTimer)
def updateControls(self):
def updateControls(self, layout=True):
view = self.graphFrame.getView()
self.ySubSelection.Clear()
self.xSubSelection.Clear()
@@ -127,9 +127,12 @@ class GraphControlPanel(wx.Panel):
# Target list
self.targetList.Show(view.hasTargets)
# Inputs
self.updateInputs()
self.graphFrame.Layout()
self.graphFrame.UpdateWindowSize()
if layout:
self.graphFrame.Layout()
self.graphFrame.UpdateWindowSize()
def updateInputs(self):
# Clean up old inputs