Skip to content

Commit

Permalink
added: have the context menu interpret the CONTEXT_MENU action as a c…
Browse files Browse the repository at this point in the history
…lose

this is useful with e.g. nyx boards when you want to map the USER button
to the context menu. since it can only be mapped to builtin commands,
you have to use Action(ContextMenu). with this, you can close the
menu using the same button
  • Loading branch information
spiff committed Oct 26, 2011
1 parent cfa1a05 commit 33c3065
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions xbmc/dialogs/GUIDialogContextMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,17 @@ bool CGUIDialogContextMenu::OnMessage(CGUIMessage &message)
return CGUIDialog::OnMessage(message);
}

bool CGUIDialogContextMenu::OnAction(const CAction& action)
{
if (action.GetID() == ACTION_CONTEXT_MENU)
{
Close();
return true;
}

return CGUIDialog::OnAction(action);
}

void CGUIDialogContextMenu::OnInitWindow()
{
m_clickedButton = -1;
Expand Down
1 change: 1 addition & 0 deletions xbmc/dialogs/GUIDialogContextMenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ class CGUIDialogContextMenu :
CGUIDialogContextMenu(void);
virtual ~CGUIDialogContextMenu(void);
virtual bool OnMessage(CGUIMessage &message);
virtual bool OnAction(const CAction& action);
virtual void SetPosition(float posX, float posY);

static bool SourcesMenu(const CStdString &strType, const CFileItemPtr item, float posX, float posY);
Expand Down

0 comments on commit 33c3065

Please sign in to comment.