From 2a5aafb27419efb36999e24dbcc091eacea56286 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Tue, 1 May 2018 21:20:21 +0200 Subject: [PATCH] Fix missing tool in the overflow menu of wxAuiToolBar When determining if a tool is hidden, it takes the width (or height) of the overflow sizer into account -- but when tools are overlapping, this is 0. By setting and getting the minimum size of the overflow sizer, the actual size of the overflow button can be used. Closes #17960. Closes https://github.com/wxWidgets/wxWidgets/pull/799 --- docs/changes.txt | 1 + src/aui/auibar.cpp | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 2d67ba9c11..973a1fb904 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -79,6 +79,7 @@ All: All (GUI): - Improve stock items consistency and aesthetics (dhowland). +- Fix bug with missing items in overflowing AUI toolbar (Maarten Bent). wxGTK: diff --git a/src/aui/auibar.cpp b/src/aui/auibar.cpp index 2c5155a94b..3d6c1326a6 100644 --- a/src/aui/auibar.cpp +++ b/src/aui/auibar.cpp @@ -1773,7 +1773,7 @@ bool wxAuiToolBar::GetToolFitsByIndex(int tool_idx) const { // take the dropdown size into account if (m_overflowVisible && m_overflowSizerItem) - cli_h -= m_overflowSizerItem->GetSize().y; + cli_h -= m_overflowSizerItem->GetMinSize().y; if (rect.y+rect.height < cli_h) return true; @@ -1782,7 +1782,7 @@ bool wxAuiToolBar::GetToolFitsByIndex(int tool_idx) const { // take the dropdown size into account if (m_overflowVisible && m_overflowSizerItem) - cli_w -= m_overflowSizerItem->GetSize().x; + cli_w -= m_overflowSizerItem->GetMinSize().x; if (rect.x+rect.width < cli_w) return true; @@ -2024,6 +2024,7 @@ bool wxAuiToolBar::RealizeHelper(wxClientDC& dc, bool horizontal) m_overflowSizerItem = sizer->Add(overflow_size, 1, 0, wxEXPAND); else m_overflowSizerItem = sizer->Add(1, overflow_size, 0, wxEXPAND); + m_overflowSizerItem->SetMinSize(m_overflowSizerItem->GetSize()); } else {