From 26455c1010e02fa16fb131e8154e1488d4bc24b6 Mon Sep 17 00:00:00 2001 From: HomeWorld Date: Mon, 8 Nov 2010 09:08:51 +0200 Subject: [PATCH] Really, dont create a bitmap with Over9000 px width --- miniframe.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/miniframe.py b/miniframe.py index ead9e6a8d..1e3e02755 100644 --- a/miniframe.py +++ b/miniframe.py @@ -285,6 +285,7 @@ class PFTabsContainer(wx.Window): self.height = height self.reserved = 24 self.tabContainerWidth = width - self.reserved + self.tabMinWidth = 0 self.tabShadow = None self.Bind(wx.EVT_PAINT, self.OnPaint) @@ -412,13 +413,16 @@ class PFTabsContainer(wx.Window): return len(self.tabs) def AdjustTabsSize(self): - self.tabMinWidth = 9000000 # Really, it should be over 9000 + tabMinWidth = 9000000 # Really, it should be over 9000 for tab in self.tabs: tx,ty = tab.GetMinSize() - if self.tabMinWidth > tx: - self.tabMinWidth = tx - if self.GetTabsCount() * self.tabMinWidth > self.tabContainerWidth: - self.tabMinWidth = (self.tabContainerWidth - self.reserved) / self.GetTabsCount() + if tabMinWidth > tx: + tabMinWidth = tx + if self.GetTabsCount() >0: + if self.GetTabsCount() * tabMinWidth > self.tabContainerWidth: + self.tabMinWidth = (self.tabContainerWidth - self.reserved) / self.GetTabsCount() + else: + self.tabMinWidth = 0 for tab in self.tabs: tab.SetSize( (self.tabMinWidth, self.height) ) self.CreateShadow()