I’m working on a layout that has a lot of buttons with left- and right- aligned text on an esp32. I think this kind of layout is reasonably common – for example, on this forum each topic has the title text left-aligned and replies/views/activity right-aligned. I’d love to use button matrices to implement this, as using individual lists and labels uses a whopping 80kB of memory just for the layout. I know that I could use several button matrices on top of each other to draw multiple pieces of text on each button, but it looks like there is no way to align the text in each of the button matrix’s buttons to anything other than the buttons’ respective centers.
If I’m missing a feature that could be used to easily implement this or if there are other text alignment plans for v7.0 I’d love to hear about them. Otherwise, I’d be happy to implement this and file a PR for it. After doing some testing, it looks like only the following bit of code in lv_btnm.c needs modified, although functions to allow this to be changed, documentation, etc. would also be necessary.
area_tmp.x1 += (btn_w - txt_size.x) / 2; area_tmp.y1 += (btn_h - txt_size.y) / 2;