Description
When a line break is in a button matrix text map item. The text is aligned as LV_LABEL_ALIGN_LEFT
would align it for a label.
I would like it aligned as LV_LABEL_ALIGN_CENTER
would align it for a label.
What MCU/Processor/Board and compiler are you using?
TFT Simulator
What do you want to achieve?
To have the symbols centralized above the text. Please see screenshot.
What have you tried so far?
Nothing yet, no idea how to.
Code to reproduce
lv_obj_t* scr = lv_scr_act();
lv_obj_t* btnmatrix = lv_btnmatrix_create(scr, NULL);
static const char* const btnmatrix_map[] = {
LV_SYMBOL_LOOP"\nManual Run",
LV_SYMBOL_PLUS"\nNew Test",
LV_SYMBOL_REFRESH"\nCurrent Test",
LV_SYMBOL_MINUS"\nPrevious Test",
LV_SYMBOL_SETTINGS"\nSettings",
"",
};
lv_btnmatrix_set_map(btnmatrix, (const char**)btnmatrix_map);
lv_obj_set_width(btnmatrix, lv_obj_get_width(scr));
lv_obj_set_height(btnmatrix, LV_DPI * 3 / 4);
lv_obj_align(btnmatrix, NULL, LV_ALIGN_IN_BOTTOM_MID, 0, 0);