From 60bf53fa378f790d46c64daa71f0baaec3c55a98 Mon Sep 17 00:00:00 2001 From: HomeWorld Date: Mon, 16 May 2011 14:46:48 +0300 Subject: [PATCH] Small tinkering for race selection (appearance) --- gui/mainFrame.py | 2 +- gui/shipBrowser.py | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/gui/mainFrame.py b/gui/mainFrame.py index 152654d1a..1a9696daf 100644 --- a/gui/mainFrame.py +++ b/gui/mainFrame.py @@ -117,7 +117,7 @@ class MainFrame(wx.Frame): self.notebookBrowsers.SetSelection(1) self.splitter.SplitVertically(self.notebookBrowsers, self.FitviewAdditionsPanel) - self.splitter.SetMinimumPaneSize(200) + self.splitter.SetMinimumPaneSize(204) self.splitter.SetSashPosition(300) cstatsSizer = wx.BoxSizer(wx.VERTICAL) diff --git a/gui/shipBrowser.py b/gui/shipBrowser.py index f80651019..9b930ed78 100644 --- a/gui/shipBrowser.py +++ b/gui/shipBrowser.py @@ -123,8 +123,23 @@ class RaceSelector(wx.Window): self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnBackgroundErase) self.Bind(wx.EVT_PAINT, self.OnPaint) self.Bind(wx.EVT_LEFT_UP, self.OnLeftUp) + self.Bind(wx.EVT_SIZE, self.OnSizeUpdate) + self.Layout() + + def OnSizeUpdate(self,event): + rect = self.GetRect() + + if self.layout == wx.HORIZONTAL: + width = 0 + for bmp in self.raceBmps: + width += bmp.GetWidth() + self.buttonsPadding + posx = (rect.width - width)/2 + self.buttonsBarPos = (posx,0) + self.Refresh() + event.Skip() + def OnLeftUp(self, event): mx,my = event.GetPosition()