Fix ribbon page layout wrong when scroll button is shown or hidden due to a scroll operation

See #17454
This commit is contained in:
Paul Cornett
2017-12-03 10:04:23 -08:00
parent 91d8082cc9
commit a671974bab
2 changed files with 6 additions and 3 deletions

View File

@@ -75,7 +75,7 @@ protected:
bool ExpandPanels(wxOrientation direction, int maximum_amount);
bool CollapsePanels(wxOrientation direction, int minimum_amount);
void ShowScrollButtons();
bool ShowScrollButtons();
void HideScrollButtons();
void CommonInit(const wxString& label, const wxBitmap& icon);

View File

@@ -338,7 +338,8 @@ bool wxRibbonPage::ScrollPixels(int pixels)
child->SetPosition(wxPoint(x, y));
}
ShowScrollButtons();
if (ShowScrollButtons())
DoActualLayout();
Refresh();
return true;
}
@@ -788,7 +789,7 @@ void wxRibbonPage::HideScrollButtons()
ShowScrollButtons();
}
void wxRibbonPage::ShowScrollButtons()
bool wxRibbonPage::ShowScrollButtons()
{
bool show_left = true;
bool show_right = true;
@@ -891,6 +892,8 @@ void wxRibbonPage::ShowScrollButtons()
{
wxDynamicCast(GetParent(), wxRibbonBar)->RepositionPage(this);
}
return reposition;
}
static int GetSizeInOrientation(wxSize size, wxOrientation orientation)