Fix a bug in calculating whether a tool fits into the AuiToolBar.

This commit is contained in:
Tianzhu Qiao
2018-05-27 16:08:28 -07:00
committed by Robin Dunn
parent a49a0062e0
commit ae4a5dc665
2 changed files with 4 additions and 2 deletions

View File

@@ -105,6 +105,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)

View File

@@ -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