mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
Add the LED color switch to exam_pop_up_controller.
This commit is contained in:
@@ -3,6 +3,9 @@
|
||||
#include <apps/i18n.h>
|
||||
#include "global_preferences.h"
|
||||
#include <assert.h>
|
||||
#include <poincare/preferences.h>
|
||||
|
||||
using namespace Poincare;
|
||||
|
||||
ExamPopUpController::ExamPopUpController(ExamPopUpControllerDelegate * delegate) :
|
||||
ViewController(nullptr),
|
||||
@@ -56,10 +59,24 @@ ExamPopUpController::ContentView::ContentView(Responder * parentResponder) :
|
||||
ExamPopUpController * controller = (ExamPopUpController *)context;
|
||||
GlobalPreferences::ExamMode nextExamMode = controller->isActivatingExamMode() ? GlobalPreferences::ExamMode::Activate : GlobalPreferences::ExamMode::Deactivate;
|
||||
GlobalPreferences::sharedGlobalPreferences()->setExamMode(nextExamMode);
|
||||
Preferences * preferences = Preferences::sharedPreferences();
|
||||
AppsContainer * container = (AppsContainer *)controller->app()->container();
|
||||
if (controller->isActivatingExamMode()) {
|
||||
container->reset();
|
||||
Ion::LED::setColor(KDColorBlue);
|
||||
switch ((int)preferences->colorOfLED()) {
|
||||
case 0:
|
||||
Ion::LED::setColor(KDColorWhite);
|
||||
break;
|
||||
case 1:
|
||||
Ion::LED::setColor(KDColorGreen);
|
||||
break;
|
||||
case 2:
|
||||
Ion::LED::setColor(KDColorBlue);
|
||||
break;
|
||||
case 3:
|
||||
Ion::LED::setColor(KDColorYellow);
|
||||
break;
|
||||
}
|
||||
Ion::LED::setBlinking(1000, 0.1f);
|
||||
} else {
|
||||
Ion::LED::setColor(KDColorBlack);
|
||||
|
||||
Reference in New Issue
Block a user