From af1ef072ab8ae26597ef7e0f92ee65fedb9dc335 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Tue, 10 Sep 2019 13:24:47 +0200 Subject: [PATCH] libroar/RoarWindowAbout.py: cleanup. --- libroar/RoarWindowAbout.py | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/libroar/RoarWindowAbout.py b/libroar/RoarWindowAbout.py index cef73d9..420cbe5 100644 --- a/libroar/RoarWindowAbout.py +++ b/libroar/RoarWindowAbout.py @@ -14,37 +14,36 @@ class RoarWindowAbout(wx.Dialog): # }}} # - # __init__(self, parent, size=(320, 240), title="About roar") - def __init__(self, parent, size=(320, 240), title="About roar"): - super().__init__(parent, size=size, title=title) - self.panel, self.sizer, self.sizerH1, self.sizerH2 = wx.Panel(self), wx.BoxSizer(wx.VERTICAL), wx.BoxSizer(wx.HORIZONTAL), wx.BoxSizer(wx.HORIZONTAL) + # __init__(self, parent, minSize=(320, 300), title="About roar") + def __init__(self, parent, minSize=(320, 300), title="About roar"): + super().__init__(parent, size=minSize, title=title) + self.panel, self.sizer, self.sizerH = wx.Panel(self), wx.BoxSizer(wx.VERTICAL), [wx.BoxSizer(wx.HORIZONTAL), wx.BoxSizer(wx.HORIZONTAL), wx.BoxSizer(wx.HORIZONTAL)] logoPathNames = glob(os.path.join("assets", "images", "logo*.bmp")) logoPathName = logoPathNames[random.randint(0, len(logoPathNames) - 1)] - self.logo = wx.StaticBitmap(self, -1, wx.Bitmap(logoPathName)) - self.sizerH1.Add(self.logo, 0, wx.CENTER) + self.logo = wx.StaticBitmap(self.panel, -1, wx.Bitmap(logoPathName)) + self.sizerH[0].Add(self.logo, 0, wx.ALL | wx.CENTER, 4) self.title = wx.StaticText(self.panel, label="roar -- mIRC art editor for Windows && Linux\nGit revision __ROAR_RELEASE_GIT_SHORT_REV__\nhttps://www.github.com/lalbornoz/roar/\nCopyright (c) 2018, 2019 Lucio Andrés Illanes Albornoz ", style=wx.ALIGN_CENTER) self.title.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.NORMAL, underline=False)) - self.sizer.Add(self.title) + self.sizerH[1].Add(self.title, 0, wx.ALL | wx.CENTER, 3) - labelsText = ["roar!", "ROAR!", "roaaaaaaar!", "ROAROARAOR", "_ROAR_"] + labelsText = ["&roar!", "&ROAR!", "&roaaaaaaar!", "&ROAROARAOR", "_&ROAR_"] labelText = labelsText[random.randint(0, len(labelsText) - 1)] - self.buttonRoar = wx.Button(self.panel, label=labelText, pos=(75, 10)) + self.buttonRoar = wx.Button(self.panel, label=labelText) self.buttonRoar.Bind(wx.EVT_BUTTON, self.onButtonRoar) - self.sizerH2.Add(self.buttonRoar, 0, wx.CENTER) + self.sizerH[2].Add(self.buttonRoar, 0, wx.ALL | wx.CENTER, 2) - self.sizer.Add(self.sizerH1, 0, wx.CENTER) - self.sizer.Add(self.sizerH2, 0, wx.CENTER) - self.SetSizer(self.sizer); self.sizer.Fit(self.panel); - self.SetSize(size); self.SetTitle(title); self.Center(); + [self.sizer.Add(sizer, 0, wx.CENTER) for sizer in self.sizerH] + self.panel.SetSizerAndFit(self.sizer) + self.SetClientSize(self.sizer.ComputeFittingClientSize(self)); self.Center(); + self.SetTitle(title) soundBitePathNames = glob(os.path.join("assets", "audio", "roar*.wav")) soundBitePathName = soundBitePathNames[random.randint(0, len(logoPathNames) - 1)] self.soundBite = wx.adv.Sound(soundBitePathName) if self.soundBite.IsOk(): self.soundBite.Play(wx.adv.SOUND_ASYNC) - self.ShowModal() # vim:expandtab foldmethod=marker sw=4 ts=4 tw=120