From 9834e9e18e1236e0db5c615321d212c06567c3c6 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Wed, 2 Jan 2019 23:00:13 +0100 Subject: [PATCH] - lcd4l-setup: use new GetMaxBrightness() function Signed-off-by: GetAway --- src/gui/lcd4l_setup.cpp | 18 ++++++++++-------- src/gui/lcd4l_setup.h | 2 +- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/gui/lcd4l_setup.cpp b/src/gui/lcd4l_setup.cpp index c17e1028c..860a5e48a 100644 --- a/src/gui/lcd4l_setup.cpp +++ b/src/gui/lcd4l_setup.cpp @@ -4,7 +4,7 @@ Copyright (C) 2012 'defans' Homepage: http://www.bluepeercrew.us/ - Copyright (C) 2012-2016 'vanhofen' + Copyright (C) 2012-2018 'vanhofen' Homepage: http://www.neutrino-images.de/ Modded (C) 2016 'TangoCash' @@ -148,6 +148,7 @@ int CLCD4lSetup::show() int temp_lcd4l_dpf_type = g_settings.lcd4l_dpf_type; int temp_lcd4l_skin = g_settings.lcd4l_skin; + int temp_lcd4l_brightness = g_settings.lcd4l_brightness; // lcd4l setup CMenuWidget* lcd4lSetup = new CMenuWidget(LOCALE_LCD4L_SUPPORT, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_LCD4L_SETUP); @@ -174,16 +175,11 @@ int CLCD4lSetup::show() mc->setHint("", LOCALE_MENU_HINT_LCD4L_SKIN_RADIO); lcd4lSetup->addItem(mc); - int max_brightness = 7; -#if defined BOXMODEL_VUSOLO4K - max_brightness = 10; -#endif - - nc = new CMenuOptionNumberChooser(LOCALE_LCD4L_BRIGHTNESS, (int *)&g_settings.lcd4l_brightness, true, 1, max_brightness, this); + nc = new CMenuOptionNumberChooser(LOCALE_LCD4L_BRIGHTNESS, (int *)&temp_lcd4l_brightness, true, 1, LCD4l->GetMaxBrightness(), this); nc->setHint("", LOCALE_MENU_HINT_LCD4L_BRIGHTNESS); lcd4lSetup->addItem(nc); - nc = new CMenuOptionNumberChooser(LOCALE_LCD4L_BRIGHTNESS_STANDBY, (int *)&g_settings.lcd4l_brightness_standby, true, 1, max_brightness, this); + nc = new CMenuOptionNumberChooser(LOCALE_LCD4L_BRIGHTNESS_STANDBY, (int *)&g_settings.lcd4l_brightness_standby, true, 1, LCD4l->GetMaxBrightness(), this); nc->setHint("", LOCALE_MENU_HINT_LCD4L_BRIGHTNESS_STANDBY); lcd4lSetup->addItem(nc); @@ -222,5 +218,11 @@ int CLCD4lSetup::show() LCD4l->InitLCD4l(); } + if (g_settings.lcd4l_brightness != temp_lcd4l_brightness) + { + g_settings.lcd4l_brightness = temp_lcd4l_brightness; + LCD4l->InitLCD4l(); + } + return res; } diff --git a/src/gui/lcd4l_setup.h b/src/gui/lcd4l_setup.h index 6242edaca..511bfa3f3 100644 --- a/src/gui/lcd4l_setup.h +++ b/src/gui/lcd4l_setup.h @@ -4,7 +4,7 @@ Copyright (C) 2012 'defans' Homepage: http://www.bluepeercrew.us/ - Copyright (C) 2012-2016 'vanhofen' + Copyright (C) 2012-2018 'vanhofen' Homepage: http://www.neutrino-images.de/ Modded (C) 2016 'TangoCash'