mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2025-04-21 12:27:27 +03:00
SettingsDialog: simplify code using InputManager::waitForPressedButton().
Replaced MenuSetting::manageInput() by handleButtonPress(), because we will only pass pressed buttons to it, not the entire input event.
This commit is contained in:
@@ -64,14 +64,14 @@ void MenuSettingBool::draw(int y)
|
||||
gmenu2x->s->write( gmenu2x->font, strvalue, 155, y, ASFont::HAlignLeft, ASFont::VAlignTop );
|
||||
}
|
||||
|
||||
bool MenuSettingBool::manageInput(InputManager::ButtonEvent *event)
|
||||
bool MenuSettingBool::handleButtonPress(InputManager::Button button)
|
||||
{
|
||||
if (event->button == InputManager::ACCEPT
|
||||
&& event->state == InputManager::PRESSED) {
|
||||
if (button == InputManager::ACCEPT) {
|
||||
toggle();
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void MenuSettingBool::toggle()
|
||||
|
||||
Reference in New Issue
Block a user