From d3d1c37bf5e98a8882376bc78f5693c422454f4b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 21 Aug 2014 14:13:07 +0000 Subject: [PATCH] Fix ribbon bar tab width computation if the first tab is hidden. The logic for the first tab should really deal with the first visible tab as the actual first tab might be hidden and in this case we shouldn't account for it at all. Closes #16432. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@77092 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/ribbon/bar.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ribbon/bar.cpp b/src/ribbon/bar.cpp index 1bad16a18b..989aca8ba8 100644 --- a/src/ribbon/bar.cpp +++ b/src/ribbon/bar.cpp @@ -142,6 +142,7 @@ bool wxRibbonBar::Realize() wxClientDC dcTemp(this); int sep = m_art->GetMetric(wxRIBBON_ART_TAB_SEPARATION_SIZE); size_t numtabs = m_pages.GetCount(); + bool firstVisible = true; size_t i; for(i = 0; i < numtabs; ++i) { @@ -165,8 +166,10 @@ bool wxRibbonBar::Realize() &info.small_must_have_separator_width, &info.minimum_width); - if(i == 0) + if ( firstVisible ) { + firstVisible = false; + m_tabs_total_width_ideal = info.ideal_width; m_tabs_total_width_minimum = info.minimum_width; }