1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-11-30 00:05:21 +02:00

MenuSettingBool: Support toggling of boolean settings using left/right.

This commit is contained in:
Maarten ter Huurne 2011-10-23 09:47:51 +02:00
parent a38c283e17
commit 641c989934

View File

@ -66,12 +66,16 @@ void MenuSettingBool::draw(int y)
bool MenuSettingBool::handleButtonPress(InputManager::Button button) bool MenuSettingBool::handleButtonPress(InputManager::Button button)
{ {
if (button == InputManager::ACCEPT) { switch (button) {
toggle(); case InputManager::ACCEPT:
return true; case InputManager::LEFT:
} else { case InputManager::RIGHT:
return false; toggle();
break;
default:
return false;
} }
return true;
} }
void MenuSettingBool::toggle() void MenuSettingBool::toggle()