diff --git a/apps/apps_container.cpp b/apps/apps_container.cpp index 4a9afed0b..c352f44c4 100644 --- a/apps/apps_container.cpp +++ b/apps/apps_container.cpp @@ -4,6 +4,7 @@ #include #include #include +#include extern "C" { #include @@ -220,7 +221,7 @@ bool AppsContainer::processEvent(Ion::Events::Event event) { } 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); } return false; diff --git a/apps/apps_container.h b/apps/apps_container.h index 60efccdd9..87c0adea6 100644 --- a/apps/apps_container.h +++ b/apps/apps_container.h @@ -78,7 +78,6 @@ private: OnBoarding::App::Snapshot m_onBoardingSnapshot; HardwareTest::App::Snapshot m_hardwareTestSnapshot; USB::App::Snapshot m_usbConnectedSnapshot; - const int NumberOfStepsForShiftPlusMinus = 3; }; #endif diff --git a/apps/settings/main_controller.cpp b/apps/settings/main_controller.cpp index 59d5075ec..12419bc55 100644 --- a/apps/settings/main_controller.cpp +++ b/apps/settings/main_controller.cpp @@ -2,6 +2,7 @@ #include "../global_preferences.h" #include #include +#include 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; diff --git a/apps/settings/main_controller.h b/apps/settings/main_controller.h index b6bf9c7d6..2a371b0c9 100644 --- a/apps/settings/main_controller.h +++ b/apps/settings/main_controller.h @@ -42,7 +42,6 @@ private: AccessibilityController m_accessibilityController; ExamModeController m_examModeController; AboutController m_aboutController; - const int NumberOfStepsForShiftPlusMinus = 3; }; } diff --git a/ion/include/ion/backlight.h b/ion/include/ion/backlight.h index cd69ee888..89a19687c 100644 --- a/ion/include/ion/backlight.h +++ b/ion/include/ion/backlight.h @@ -12,6 +12,7 @@ bool isInitialized(); void shutdown(); void setBrightness(uint8_t b); uint8_t brightness(); +const int NumberOfStepsPerShortcut = 4; } }