CGUIDialogSelect: focus the extra button (if available) when the selection list is...
authormontellese <montellese@xbmc.org>
Wed, 26 Feb 2014 17:15:27 +0000 (18:15 +0100)
committermontellese <montellese@xbmc.org>
Wed, 26 Feb 2014 17:16:10 +0000 (18:16 +0100)
xbmc/dialogs/GUIDialogSelect.cpp

index 453994c..3e9fb10 100644 (file)
@@ -132,6 +132,14 @@ bool CGUIDialogSelect::OnMessage(CGUIMessage& message)
     break;
   case GUI_MSG_SETFOCUS:
     {
+      // make sure the additional button is focused in case the list is empty
+      // (otherwise it is impossible to navigate to the additional button)
+      if (m_vecList->IsEmpty() && m_bButtonEnabled &&
+          m_viewControl.HasControl(message.GetControlId()))
+      {
+        SET_CONTROL_FOCUS(CONTROL_BUTTON, 0);
+        return true;
+      }
       if (m_viewControl.HasControl(message.GetControlId()) && m_viewControl.GetCurrentControl() != message.GetControlId())
       {
         m_viewControl.SetFocused();