GEM icon indicating copy to clipboard operation
GEM copied to clipboard

Supports setting single one menu attributes

Open TimonPeng opened this issue 1 year ago • 1 comments

When I want to setting only one or a a little attributes, it need to fill complete instance here. Do you want to support a set function like setMenuItemHeight etc.?

before:

GEM_u8g2 menu(u8g2, /*menuPointerType_=*/GEM_POINTER_ROW,
              /*menuItemsPerScreen_=*/GEM_ITEMS_COUNT_AUTO,
              /*menuItemHeight_=*/12,
              /*menuPageScreenTopOffset_=*/10, /*menuValuesLeftOffset_=*/86);

after:

GEM_u8g2 menu(u8g2);
menu.setMenuItemHeight(12);

TimonPeng avatar Aug 27 '22 05:08 TimonPeng

I can see that being convenient way of adjusting menu appearance on per parameter basis, but since the memory footprint is of a high concern (Example-03 barely fits on Arduino UNO in some versions of GEM) and this is generally done only once in the sketch, I figured that managing appearance simply through constructor arguments is a better way to go about it. So adding this is not of a high priority as of now, unfortunately. But at least I can run some tests to check how adding these new methods impacts compile size.

Spirik avatar Aug 27 '22 20:08 Spirik