1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2025-04-21 12:27:27 +03:00

Handle menu-related buttons inside Menu class

This commit is contained in:
Maarten ter Huurne
2013-08-05 16:43:22 +02:00
parent d588b97b34
commit 074668336e
3 changed files with 60 additions and 41 deletions

View File

@@ -207,6 +207,34 @@ void Menu::paint(Surface &s) {
}
}
bool Menu::handleButtonPress(InputManager::Button button) {
switch (button) {
case InputManager::ACCEPT:
if (selLink() != NULL) selLink()->run();
return true;
case InputManager::UP:
linkUp();
return true;
case InputManager::DOWN:
linkDown();
return true;
case InputManager::LEFT:
linkLeft();
return true;
case InputManager::RIGHT:
linkRight();
return true;
case InputManager::ALTLEFT:
decSectionIndex();
return true;
case InputManager::ALTRIGHT:
incSectionIndex();
return true;
default:
return false;
}
}
void Menu::handleTS() {
ConfIntHash &skinConfInt = gmenu2x->skinConfInt;
const int topBarHeight = skinConfInt["topBarHeight"];