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.
This commit is contained in:
Paul Kulchenko
2015-11-01 19:12:05 +01:00
committed by Vadim Zeitlin
parent a916a0cc48
commit 223c5cda2b

View File

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