How to inherit theme button style for button matrix


When I create a button matrix, the style of the buttons in a button matrix are not the same as in case of standalone buttons. See the screenshot: first 2 buttons are active, 3rd is inactive. On the 4th place there is a button matrix with 2 buttons.

What MCU/Processor/Board and compiler are you using?

What do you want to achieve?

I would expect to have the same style for button matrix buttons as for standalone buttons. 2 questions:

  1. Why can it be different, what do I miss?
  2. What would be the easiest way to “copy” the styles of the standalone buttons for the button matrix?

Code to reproduce

I have set material theme, the 1st button has the following settings:

/* Create spindle direction button */
lv_obj_t * btnSpindleDir = lv_btn_create(contColumn,NULL);
lv_obj_set_width(btnSpindleDir, LV_DPI);
lv_obj_set_height(btnSpindleDir, buttonHeight);

2nd and 3rd is the same, 3rd is inactive. What I set so far for the 4th (button matrix):

lv_obj_t * btnmFeederMove = lv_btnm_create(contColumn, NULL);
lv_obj_set_width(btnmFeederMove, LV_DPI);
lv_obj_set_height(btnmFeederMove, buttonHeight);

The result is what you can see on the screenshot: button matrix is white, has not the same hue color what I have for the material theme.



I believe that this is the expected behavior. Button matrices using the “material” theme are white by default.

Simple example (you may need to extend it based on your requirements):

	lv_theme_t *th = lv_theme_material_init(210, NULL);

	lv_obj_t * btnm_fakebuttons = lv_btnm_create(lv_scr_act(), NULL);
	lv_obj_set_width(btnm_fakebuttons, LV_DPI);
	lv_obj_set_height(btnm_fakebuttons, LV_DPI * 2);
	lv_btnm_set_style(btnm_fakebuttons, LV_BTNM_STYLE_BTN_REL, th->style.btn.rel);
	lv_btnm_set_style(btnm_fakebuttons, LV_BTNM_STYLE_BTN_PR, th->;