Skip to content

Commit

Permalink
Always highlight the OK button when installing an add-on
Browse files Browse the repository at this point in the history
  • Loading branch information
gusandrianos committed Nov 21, 2019
1 parent 23c724a commit 6d34db9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions xbmc/addons/GUIDialogAddonInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,7 @@ bool CGUIDialogAddonInfo::ShowDependencyList(const std::vector<ADDON::Dependency
for (auto& it : items)
pDialog->Add(*it);
pDialog->EnableButton(!reactivate, 186);
pDialog->SetButtonFocus(true);
pDialog->Open();

if (pDialog->IsButtonPressed())
Expand Down
8 changes: 7 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())
if (m_vecList->IsEmpty() || m_focusToButton)
{
if (m_bButtonEnabled)
SET_CONTROL_FOCUS(CONTROL_EXTRA_BUTTON, 0);
Expand Down Expand Up @@ -168,6 +168,7 @@ void CGUIDialogSelect::Reset()
m_bButtonPressed = false;
m_useDetails = false;
m_multiSelection = false;
m_focusToButton = false;
m_selectedItem = nullptr;
m_vecList->Clear();
m_selectedItems.clear();
Expand Down Expand Up @@ -279,6 +280,11 @@ void CGUIDialogSelect::SetMultiSelection(bool multiSelection)
m_multiSelection = multiSelection;
}

void CGUIDialogSelect::SetButtonFocus(bool buttonFocus)
{
m_focusToButton = buttonFocus;
}

CGUIControl *CGUIDialogSelect::GetFirstFocusableControl(int id)
{
if (m_viewControl.HasControl(id))
Expand Down
2 changes: 2 additions & 0 deletions xbmc/dialogs/GUIDialogSelect.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class CGUIDialogSelect : public CGUIDialogBoxBase
void SetSelected(const std::vector<std::string> &selectedLabels);
void SetUseDetails(bool useDetails);
void SetMultiSelection(bool multiSelection);
void SetButtonFocus(bool buttonFocus);

protected:
explicit CGUIDialogSelect(int windowid);
Expand All @@ -59,6 +60,7 @@ class CGUIDialogSelect : public CGUIDialogBoxBase
CFileItemPtr m_selectedItem;
bool m_useDetails;
bool m_multiSelection;
bool m_focusToButton{};

std::vector<int> m_selectedItems;
std::unique_ptr<CFileItemList> m_vecList;
Expand Down

0 comments on commit 6d34db9

Please sign in to comment.