From 223c5cda2b5f9a317a4a0420fe5717753c2dfd53 Mon Sep 17 00:00:00 2001 From: Paul Kulchenko Date: Sun, 1 Nov 2015 19:12:05 +0100 Subject: [PATCH] Show as many tabs in wxAuiNotebook as possible Currently, when a tab is closed in wxAuiNotebook, the tabs are not moved right to use free space (on the right side of he rightmost tab), which requires clicking "left" button to make tabs visible. This commit changes the behaviour to keep as many tabs shown as possible. Closes #17233. --- src/aui/auibook.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/aui/auibook.cpp b/src/aui/auibook.cpp index 92f7fb33d5..1d9ac95e9f 100644 --- a/src/aui/auibook.cpp +++ b/src/aui/auibook.cpp @@ -431,6 +431,10 @@ void wxAuiTabContainer::Render(wxDC* raw_dc, wxWindow* wnd) if (!dc.IsOk()) return; + // ensure we show as many tabs as possible + while (m_tabOffset > 0 && IsTabVisible(page_count-1, m_tabOffset-1, &dc, wnd)) + --m_tabOffset; + // find out if size of tabs is larger than can be // afforded on screen int total_width = 0;