From 57219f56e7d52c4eaf5601499c15ca05e6c57444 Mon Sep 17 00:00:00 2001 From: cncfanatics Date: Fri, 20 Aug 2010 22:06:14 +0200 Subject: [PATCH] Hopefully fix the button sizing issue once and for all --- gui/shipBrowser.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gui/shipBrowser.py b/gui/shipBrowser.py index 500c868e2..054bce9ef 100644 --- a/gui/shipBrowser.py +++ b/gui/shipBrowser.py @@ -182,8 +182,13 @@ class ShipMenu(wx.Panel): for name, art in (("new", wx.ART_NEW), ("rename", bitmapLoader.getBitmap("rename", "icons")), ("copy", wx.ART_COPY), ("delete", wx.ART_DELETE)): bitmap = wx.ArtProvider.GetBitmap(art, wx.ART_BUTTON) if name != "rename" else art btn = wx.BitmapButton(self, wx.ID_ANY, bitmap) - btn.SetSize((30, 26)) + if size is None: + size = btn.GetSize() + else: + btn.SetMinSize(size) + btn.SetMaxSize(size) + btn.Layout() setattr(self, name, btn) btn.Enable(False) btn.SetToolTipString("%s fit." % name.capitalize())