X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a99e147a5c6e337bdde6b76ea16b86622db56427..6586750c6a4fa9084eaf5075006ca1fcfe50e818:/src/ribbon/toolbar.cpp?ds=sidebyside diff --git a/src/ribbon/toolbar.cpp b/src/ribbon/toolbar.cpp index 791da940ea..fa64dcc7f9 100644 --- a/src/ribbon/toolbar.cpp +++ b/src/ribbon/toolbar.cpp @@ -949,13 +949,11 @@ wxSize wxRibbonToolBar::GetBestSizeForParentSize(const wxSize& parentSize) const // Choose row count with largest possible area wxSize size = parentSize; - wxOrientation major_axis = m_art->GetFlags() & wxRIBBON_BAR_FLOW_VERTICAL ? - wxVERTICAL : wxHORIZONTAL; // A toolbar should maximize its width whether vertical or horizontal, so // force the major axis to be horizontal. Without this, there will be // redundant horizontal space. - major_axis = wxHORIZONTAL; + wxOrientation major_axis = wxHORIZONTAL; wxSize bestSize = m_sizes[0]; if(m_nrows_max != m_nrows_min) @@ -1149,6 +1147,8 @@ void wxRibbonToolBar::OnMouseUp(wxMouseEvent& WXUNUSED(evt)) notification.SetEventObject(this); notification.SetBar(this); ProcessEvent(notification); + + wxStaticCast(m_parent, wxRibbonPanel)->HideIfExpanded(); } // Notice that m_active_tool could have been reset by the event handler