diff --git a/CHANGES.rst b/CHANGES.rst index 030d1f3b..94b00b00 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -138,6 +138,7 @@ Changes in this release include the following: * Fixed a problem in wx.lib.mixins.listctrl.TextEditMixin where the height of the editor widget could be set to zero. (See discussion in #849) +* Fix a bug in calculating whether a tool fits into the AuiToolBar. (#863) diff --git a/wx/lib/agw/aui/auibar.py b/wx/lib/agw/aui/auibar.py index af61dc72..5c6a9d58 100644 --- a/wx/lib/agw/aui/auibar.py +++ b/wx/lib/agw/aui/auibar.py @@ -2935,11 +2935,12 @@ class AuiToolBar(wx.Control): cli_w, cli_h = self.GetClientSize() rect = self._items[tool_id].sizer_item.GetRect() + dropdown_size = self._art.GetElementSize(AUI_TBART_OVERFLOW_SIZE) if self._agwStyle & AUI_TB_VERTICAL: # take the dropdown size into account if self._overflow_visible: - cli_h -= self._overflow_sizer_item.GetSize().y + cli_h -= dropdown_size if rect.y+rect.height < cli_h: return True @@ -2948,7 +2949,7 @@ class AuiToolBar(wx.Control): # take the dropdown size into account if self._overflow_visible: - cli_w -= self._overflow_sizer_item.GetSize().x + cli_w -= dropdown_size if rect.x+rect.width < cli_w: return True