Fix ribbon bar scroll buttons visibility bug.
Fix scroll buttons update code in wxRibbonPage. Closes #14844. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72998 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
3c3b6f6063
commit
b31d6326be
@ -640,6 +640,8 @@ bool wxRibbonPage::DoActualLayout()
|
||||
ShowScrollButtons();
|
||||
else if(todo_hide_scroll_buttons)
|
||||
HideScrollButtons();
|
||||
else if(m_scroll_buttons_visible)
|
||||
ShowScrollButtons();
|
||||
|
||||
Refresh();
|
||||
return true;
|
||||
@ -678,8 +680,6 @@ void wxRibbonPage::ShowScrollButtons()
|
||||
m_scroll_buttons_visible = show_left || show_right;
|
||||
|
||||
if(show_left)
|
||||
{
|
||||
if(m_scroll_left_btn == NULL)
|
||||
{
|
||||
wxMemoryDC temp_dc;
|
||||
wxSize size;
|
||||
@ -696,13 +696,19 @@ void wxRibbonPage::ShowScrollButtons()
|
||||
size = m_art->GetScrollButtonMinimumSize(temp_dc, GetParent(), direction);
|
||||
size.SetWidth(GetSize().GetWidth());
|
||||
}
|
||||
if (m_scroll_left_btn)
|
||||
{
|
||||
m_scroll_left_btn->SetSize(size);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_scroll_left_btn = new wxRibbonPageScrollButton(this, wxID_ANY, GetPosition(), size, direction);
|
||||
reposition = true;
|
||||
}
|
||||
if(!IsShown())
|
||||
{
|
||||
m_scroll_left_btn->Hide();
|
||||
}
|
||||
reposition = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -715,8 +721,6 @@ void wxRibbonPage::ShowScrollButtons()
|
||||
}
|
||||
|
||||
if(show_right)
|
||||
{
|
||||
if(m_scroll_right_btn == NULL)
|
||||
{
|
||||
wxMemoryDC temp_dc;
|
||||
wxSize size;
|
||||
@ -734,13 +738,19 @@ void wxRibbonPage::ShowScrollButtons()
|
||||
size.SetWidth(GetSize().GetWidth());
|
||||
}
|
||||
wxPoint initial_pos = GetPosition() + GetSize() - size;
|
||||
if (m_scroll_right_btn)
|
||||
{
|
||||
m_scroll_right_btn->SetSize(size);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_scroll_right_btn = new wxRibbonPageScrollButton(this, wxID_ANY, initial_pos, size, direction);
|
||||
reposition = true;
|
||||
}
|
||||
if(!IsShown())
|
||||
{
|
||||
m_scroll_right_btn->Hide();
|
||||
}
|
||||
reposition = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user