mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-28 18:20:14 +01:00
Simplified code
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include "../global_preferences.h"
|
||||
#include <apps/i18n.h>
|
||||
#include <assert.h>
|
||||
#include <ion/backlight.h>
|
||||
|
||||
using namespace Poincare;
|
||||
|
||||
@@ -38,7 +39,7 @@ bool MainController::handleEvent(Ion::Events::Event event) {
|
||||
GlobalPreferences * globalPreferences = GlobalPreferences::sharedGlobalPreferences();
|
||||
if (event == Ion::Events::BrightnessPlus || event == Ion::Events::BrightnessMinus){
|
||||
int delta = Ion::Backlight::MaxBrightness/GlobalPreferences::NumberOfBrightnessStates;
|
||||
int direction = (event == Ion::Events::BrightnessPlus) ? NumberOfStepsForShiftPlusMinus*delta : -delta*NumberOfStepsForShiftPlusMinus;
|
||||
int direction = (event == Ion::Events::BrightnessPlus) ? Ion::Backlight::NumberOfStepsPerShortcut*delta : -delta*Ion::Backlight::NumberOfStepsPerShortcut;
|
||||
GlobalPreferences::sharedGlobalPreferences()->setBrightnessLevel(GlobalPreferences::sharedGlobalPreferences()->brightnessLevel()+direction);
|
||||
m_selectableTableView.reloadCellAtLocation(m_selectableTableView.selectedColumn(), 1);
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user