X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/98742322cdecc1f91bb90d9c804318058722eab0..b61c03cad3e5e0e4766e12dd1e26fac5fe72ff3e:/src/ribbon/toolbar.cpp diff --git a/src/ribbon/toolbar.cpp b/src/ribbon/toolbar.cpp index 6c6c8b7f5a..c64b60a997 100644 --- a/src/ribbon/toolbar.cpp +++ b/src/ribbon/toolbar.cpp @@ -949,7 +949,6 @@ wxSize wxRibbonToolBar::GetBestSizeForParentSize(const wxSize& parentSize) const // Choose row count with largest possible area wxSize size = parentSize; - int row_count = m_nrows_max; wxOrientation major_axis = m_art->GetFlags() & wxRIBBON_BAR_FLOW_VERTICAL ? wxVERTICAL : wxHORIZONTAL; @@ -968,7 +967,6 @@ wxSize wxRibbonToolBar::GetBestSizeForParentSize(const wxSize& parentSize) const GetSizeInOrientation(m_sizes[i], major_axis) > area) { area = GetSizeInOrientation(m_sizes[i], major_axis); - row_count = m_nrows_min + i; bestSize = m_sizes[i]; } } @@ -1151,6 +1149,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