~aleteoryx/muditaos

edb144eba11eab907683c773e65f7a09f909b8fb — Tomek Sobkowiak 5 years ago 8030b27
[EGD-5347] Save/load brightness mode

Properly display mode as OnOff switch on screen.
M module-apps/application-settings-new/windows/DisplayLightWindow.cpp => module-apps/application-settings-new/windows/DisplayLightWindow.cpp +2 -3
@@ 13,14 13,13 @@

namespace gui
{

    DisplayLightWindow::DisplayLightWindow(app::Application *app, app::settingsInterface::ScreenLightSettings *settings)
        : BaseSettingsWindow(app, window::name::display_light), screenLightSettings(settings)
    {
        auto values = screenLightSettings->getCurrentValues();

        isDisplayLightSwitchOn = values.lightOn;
        isAutoLightSwitchOn    = values.mode;
        isAutoLightSwitchOn    = values.mode == screen_light_control::ScreenLightMode::Automatic;
        brightnessValue        = values.parameters.manualModeBrightness;

        setTitle(utils::localize.get("app_settings_display_display_light"));


@@ 85,7 84,7 @@ namespace gui
        };

        auto spinner = std::make_unique<gui::SpinBoxOptionSettings>(
            utils::translateI18("app_settings_display_light_brightness") + " " + std::to_string(brightnessStep),
            utils::translateI18("app_settings_display_light_brightness") + " " + utils::to_string(brightnessStep),
            brightnessValue * brightnessStep,
            std::ceil(screen_light_control::Parameters::MAX_BRIGHTNESS / brightnessStep),
            setBrightness,

M module-services/service-evtmgr/screen-light-control/ScreenLightControl.hpp => module-services/service-evtmgr/screen-light-control/ScreenLightControl.hpp +2 -3
@@ 5,8 5,7 @@

#include <service-db/service-db/Settings.hpp>
#include "ControlFunctions.hpp"

#include <sstream>
#include <Utils.hpp>

namespace sys
{


@@ 85,7 84,7 @@ namespace screen_light_control

        template <class T> void setScreenLightSettings(const std::string &varName, T value)
        {
            settings->setValue(varName, std::to_string(value));
            settings->setValue(varName, utils::to_string(value));
        }
        void initFromSettings();