Skip to content

Commit 27c241c

Browse files
committed
SettingSteps: Update UI
Bigger buttons, use new color.
1 parent d4eb24b commit 27c241c

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

src/displayapp/screens/settings/SettingSteps.cpp

+13-5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include <lvgl/lvgl.h>
33
#include "displayapp/DisplayApp.h"
44
#include "displayapp/screens/Symbols.h"
5+
#include "displayapp/InfiniTimeTheme.h"
56

67
using namespace Pinetime::Applications::Screens;
78

@@ -42,22 +43,29 @@ SettingSteps::SettingSteps(Pinetime::Applications::DisplayApp* app, Pinetime::Co
4243
lv_obj_set_style_local_text_font(stepValue, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_42);
4344
lv_label_set_text_fmt(stepValue, "%lu", settingsController.GetStepsGoal());
4445
lv_label_set_align(stepValue, LV_LABEL_ALIGN_CENTER);
45-
lv_obj_align(stepValue, lv_scr_act(), LV_ALIGN_CENTER, 0, -10);
46+
lv_obj_align(stepValue, lv_scr_act(), LV_ALIGN_CENTER, 0, -20);
47+
48+
static constexpr uint8_t btnWidth = 115;
49+
static constexpr uint8_t btnHeight = 80;
4650

4751
btnPlus = lv_btn_create(lv_scr_act(), nullptr);
4852
btnPlus->user_data = this;
49-
lv_obj_set_size(btnPlus, 80, 50);
50-
lv_obj_align(btnPlus, lv_scr_act(), LV_ALIGN_CENTER, 55, 80);
53+
lv_obj_set_size(btnPlus, btnWidth, btnHeight);
54+
lv_obj_align(btnPlus, lv_scr_act(), LV_ALIGN_IN_BOTTOM_RIGHT, 0, 0);
55+
lv_obj_set_style_local_bg_color(btnPlus, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Colors::bgAlt);
5156
lv_obj_t* lblPlus = lv_label_create(btnPlus, nullptr);
57+
lv_obj_set_style_local_text_font(lblPlus, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_42);
5258
lv_label_set_text_static(lblPlus, "+");
5359
lv_obj_set_event_cb(btnPlus, event_handler);
5460

5561
btnMinus = lv_btn_create(lv_scr_act(), nullptr);
5662
btnMinus->user_data = this;
57-
lv_obj_set_size(btnMinus, 80, 50);
63+
lv_obj_set_size(btnMinus, btnWidth, btnHeight);
5864
lv_obj_set_event_cb(btnMinus, event_handler);
59-
lv_obj_align(btnMinus, lv_scr_act(), LV_ALIGN_CENTER, -55, 80);
65+
lv_obj_align(btnMinus, lv_scr_act(), LV_ALIGN_IN_BOTTOM_LEFT, 0, 0);
66+
lv_obj_set_style_local_bg_color(btnMinus, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Colors::bgAlt);
6067
lv_obj_t* lblMinus = lv_label_create(btnMinus, nullptr);
68+
lv_obj_set_style_local_text_font(lblMinus, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_42);
6169
lv_label_set_text_static(lblMinus, "-");
6270
}
6371

0 commit comments

Comments
 (0)