From ad17b0aad9d39951e7334386af1b9f38f87cfd6e Mon Sep 17 00:00:00 2001 From: cncfanatics Date: Fri, 20 Aug 2010 21:48:43 +0200 Subject: [PATCH] Force all shipBrowser buttons to be of the same size --- gui/shipBrowser.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gui/shipBrowser.py b/gui/shipBrowser.py index 11b71aac6..41df97fe0 100644 --- a/gui/shipBrowser.py +++ b/gui/shipBrowser.py @@ -178,9 +178,15 @@ class ShipMenu(wx.Panel): sizer = wx.BoxSizer(wx.HORIZONTAL) self.SetSizer(sizer) + size = None 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) + if size is None: + size = btn.GetSize() + else: + btn.SetSize(size) + setattr(self, name, btn) btn.Enable(False) btn.SetToolTipString("%s fit." % name.capitalize())