Skip to content

Commit 0dedc6c

Browse files
author
徐扬斌
committed
Fix wxRibbonButtonBar's layout overall size computation.
Since we've already had CalculateOverallSize, we should avoid duplicate the error-prone algorithm here. It has bug found by the assertion within TryCollapseLayout in our application.
1 parent 085a136 commit 0dedc6c

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/ribbon/buttonbar.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,7 +1066,6 @@ void wxRibbonButtonBar::MakeLayouts()
10661066
// small buttons small, stacked vertically
10671067
wxRibbonButtonBarLayout* layout = new wxRibbonButtonBarLayout;
10681068
wxPoint cursor(0, 0);
1069-
layout->overall_size.SetHeight(0);
10701069
for(btn_i = 0; btn_i < btn_count; ++btn_i)
10711070
{
10721071
wxRibbonButtonBarButtonBase* button = m_buttons.Item(btn_i);
@@ -1102,8 +1101,7 @@ void wxRibbonButtonBar::MakeLayouts()
11021101
}
11031102
layout->buttons.Add(instance);
11041103
}
1105-
layout->overall_size.SetHeight(available_height);
1106-
layout->overall_size.SetWidth(cursor.x + stacked_width);
1104+
layout->CalculateOverallSize();
11071105
m_layouts.Add(layout);
11081106
}
11091107
if(btn_count >= 2)

0 commit comments

Comments
 (0)