From d513d3e2f0d33eb2b8767bf4e26e1ec0065e13c8 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 21 Aug 2014 14:14:15 +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/trunk@77093 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 79f3966332..4c305a658f 100644 --- a/src/ribbon/bar.cpp +++ b/src/ribbon/bar.cpp @@ -162,6 +162,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) { @@ -185,8 +186,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; }