From b9224c1acedf911353156cf926848b90d8f165ae Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Thu, 11 Aug 2022 11:16:57 +0300 Subject: Disable value_str value_str is a way to add text on a button without a separate label. This saves having an extra label object, but uses more memory and is removed in LVGL8 --- src/displayapp/screens/settings/SettingSteps.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/displayapp/screens/settings/SettingSteps.cpp') diff --git a/src/displayapp/screens/settings/SettingSteps.cpp b/src/displayapp/screens/settings/SettingSteps.cpp index af5bd6e9..a6b6f4a8 100644 --- a/src/displayapp/screens/settings/SettingSteps.cpp +++ b/src/displayapp/screens/settings/SettingSteps.cpp @@ -48,7 +48,8 @@ SettingSteps::SettingSteps(Pinetime::Applications::DisplayApp* app, Pinetime::Co btnPlus->user_data = this; lv_obj_set_size(btnPlus, 80, 50); lv_obj_align(btnPlus, lv_scr_act(), LV_ALIGN_CENTER, 55, 80); - lv_obj_set_style_local_value_str(btnPlus, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, "+"); + lv_obj_t* lblPlus = lv_label_create(btnPlus, nullptr); + lv_label_set_text_static(lblPlus, "+"); lv_obj_set_event_cb(btnPlus, event_handler); btnMinus = lv_btn_create(lv_scr_act(), nullptr); @@ -56,7 +57,8 @@ SettingSteps::SettingSteps(Pinetime::Applications::DisplayApp* app, Pinetime::Co lv_obj_set_size(btnMinus, 80, 50); lv_obj_set_event_cb(btnMinus, event_handler); lv_obj_align(btnMinus, lv_scr_act(), LV_ALIGN_CENTER, -55, 80); - lv_obj_set_style_local_value_str(btnMinus, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, "-"); + lv_obj_t* lblMinus = lv_label_create(btnMinus, nullptr); + lv_label_set_text_static(lblMinus, "-"); } SettingSteps::~SettingSteps() { -- cgit v1.2.3-70-g09d2