diff --git a/sharepoint_browser.py b/sharepoint_browser.py index b0218b7..6bbc0aa 100644 --- a/sharepoint_browser.py +++ b/sharepoint_browser.py @@ -930,7 +930,6 @@ class SharePointApp(wx.Frame): # Add a Gauge to the status bar self.gauge = wx.Gauge(self.status_bar, range=100, size=(140, 18), style=wx.GA_HORIZONTAL | wx.GA_SMOOTH) self.gauge.Hide() - self.Bind(wx.EVT_SIZE, self.on_status_bar_resize) panel.SetSizer(vbox) self.Bind(wx.EVT_SIZE, self.on_resize) @@ -1361,6 +1360,9 @@ class SharePointApp(wx.Frame): if start: self.gauge.Show() self.gauge.Pulse() + rect = self.status_bar.GetFieldRect(1) + self.gauge.SetPosition((rect.x + 5, rect.y + 2)) + self.gauge.SetSize((rect.width - 10, rect.height - 4)) else: self.gauge.Hide() self.gauge.SetValue(0) @@ -1542,21 +1544,19 @@ class SharePointApp(wx.Frame): def on_resize(self, event): width = self.GetSize().width threshold = 1100 - + if width < threshold and not self.compact_mode: self.compact_mode = True self._update_button_labels(full=False) elif width >= threshold and self.compact_mode: self.compact_mode = False self._update_button_labels(full=True) - - event.Skip() - def on_status_bar_resize(self, event): if hasattr(self, 'gauge') and self.gauge: rect = self.status_bar.GetFieldRect(1) self.gauge.SetPosition((rect.x + 5, rect.y + 2)) self.gauge.SetSize((rect.width - 10, rect.height - 4)) + event.Skip() def _update_button_labels(self, full=True):