Make the size and appearance of the number and text edit controls consistent with other UI elements. (#89)

This commit is contained in:
philmoz
2023-05-07 11:25:50 +10:00
committed by GitHub
parent f84fbd01bf
commit 51ce75f10e
2 changed files with 11 additions and 0 deletions
+6
View File
@@ -54,6 +54,12 @@ NumberEdit::NumberEdit(Window* parent, const rect_t& rect, int vmin, int vmax,
lv_textarea_set_one_line(lvobj, true);
lv_obj_add_event_cb(lvobj, numberedit_cb, LV_EVENT_KEY, this);
setHeight(33);
padTop(5);
padRight(4);
lv_obj_set_style_text_align(lvobj, LV_TEXT_ALIGN_RIGHT, 0);
lv_obj_set_style_radius(lvobj, 4, 0);
update();
}
+5
View File
@@ -55,6 +55,11 @@ TextEdit::TextEdit(Window *parent, const rect_t &rect, char *value,
lv_textarea_set_placeholder_text(lvobj, "---");
lv_textarea_set_max_length(lvobj, length);
setHeight(33);
padTop(5);
padLeft(4);
lv_obj_set_style_radius(lvobj, 4, 0);
if (width() == 0) {
lv_obj_set_width(lvobj, LV_DPI_DEF);
}