Skip to content

Commit

Permalink
Merge pull request xbmc#17115 from Montellese/bugfix/select_addon_dep…
Browse files Browse the repository at this point in the history
…endencies

CGUIDialogSelect: fix focusing list / buttons after 6d34db9
  • Loading branch information
Montellese authored and Maven85 committed Jan 21, 2020
1 parent 5b23888 commit f77277b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion xbmc/dialogs/GUIDialogSelect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ bool CGUIDialogSelect::OnMessage(CGUIMessage& message)
{
if (m_viewControl.HasControl(message.GetControlId()))
{
if (m_vecList->IsEmpty() || m_focusToButton)
if (m_vecList->IsEmpty())
{
if (m_bButtonEnabled)
SET_CONTROL_FOCUS(CONTROL_EXTRA_BUTTON, 0);
Expand Down Expand Up @@ -335,6 +335,16 @@ void CGUIDialogSelect::OnInitWindow()

CGUIDialogBoxBase::OnInitWindow();

// focus one of the buttons if explicitly requested
// ATTENTION: this must be done after calling CGUIDialogBoxBase::OnInitWindow()
if (m_focusToButton)
{
if (m_bButtonEnabled)
SET_CONTROL_FOCUS(CONTROL_EXTRA_BUTTON, 0);
else
SET_CONTROL_FOCUS(CONTROL_CANCEL_BUTTON, 0);
}

// if nothing is selected, select first item
m_viewControl.SetSelectedItem(std::max(GetSelectedItem(), 0));
}
Expand Down

0 comments on commit f77277b

Please sign in to comment.