set static text as static text (#2312)
and save a few bytes of heap memory Co-authored-by: Lionel Elie Mamane <lionel@mamane.lu>
This commit is contained in:
parent
85a0542d93
commit
4f426f00a8
|
|
@ -8,8 +8,6 @@
|
||||||
|
|
||||||
using namespace Pinetime::Applications::Screens;
|
using namespace Pinetime::Applications::Screens;
|
||||||
|
|
||||||
constexpr std::array<SettingWakeUp::Option, 5> SettingWakeUp::options;
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
void event_handler(lv_obj_t* obj, lv_event_t event) {
|
void event_handler(lv_obj_t* obj, lv_event_t event) {
|
||||||
auto* screen = static_cast<SettingWakeUp*>(obj->user_data);
|
auto* screen = static_cast<SettingWakeUp*>(obj->user_data);
|
||||||
|
|
@ -45,7 +43,7 @@ SettingWakeUp::SettingWakeUp(Pinetime::Controllers::Settings& settingsController
|
||||||
|
|
||||||
for (unsigned int i = 0; i < options.size(); i++) {
|
for (unsigned int i = 0; i < options.size(); i++) {
|
||||||
cbOption[i] = lv_checkbox_create(container1, nullptr);
|
cbOption[i] = lv_checkbox_create(container1, nullptr);
|
||||||
lv_checkbox_set_text(cbOption[i], options[i].name);
|
lv_checkbox_set_text_static(cbOption[i], options[i].name);
|
||||||
if (settingsController.isWakeUpModeOn(static_cast<Controllers::Settings::WakeUpMode>(i))) {
|
if (settingsController.isWakeUpModeOn(static_cast<Controllers::Settings::WakeUpMode>(i))) {
|
||||||
lv_checkbox_set_checked(cbOption[i], true);
|
lv_checkbox_set_checked(cbOption[i], true);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue