Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Background color changed after changing factory.setDrawingPropertiesForItem #330

Closed
davetcc opened this issue Apr 12, 2023 Discussed in #329 · 1 comment
Closed

Background color changed after changing factory.setDrawingPropertiesForItem #330

davetcc opened this issue Apr 12, 2023 Discussed in #329 · 1 comment
Assignees
Labels
Milestone

Comments

@davetcc
Copy link
Collaborator

davetcc commented Apr 12, 2023

Raised by davetcc

From discussion, bug in tcMenu rendering where the renderer is getting tripped up by an item level override on the first item. This is causing the item level background to apply instead of the submenu level one.

Create a new function on the display properties that ignores the item level, specifically for these cases.

--

Discussed in #329

Originally posted by futurexdesign April 12, 2023
I have an interface as such:

TitleBar
EditableTextMenuItem (displaying a timer countdown)
Grid of 4 action items represented by icons.

I am using DarkModeModern on an LCD.
I want my timer section to be centered, with a white background and black text, but the rest of the ui to retain the black background. The issue I'm having is, after I set the drawing properties for the timer menu entry, all of the "empty" space below the grid row has become white.

I'm calling

    MenuPadding perSidePadding(4, 4, 4, 4); 
    const color_t timmerPalette[] = {RGB(0, 0, 0), RGB(255,255,255), RGB(255,255,255), RGB(255,255,255)};


    factory.setDrawingPropertiesForItem(ItemDisplayProperties::COMPTYPE_ITEM, menuTimeRemaining.getId(), timmerPalette, perSidePadding, MenuFontDef(nullptr, 7).fontData , MenuFontDef(nullptr, 7).fontMag, 2, 60, GridPosition::JUSTIFY_CENTER_VALUE_ONLY, MenuBorder(1));

in setup after setupMenu(). I'm just not entirely sure why the remaining background has become white. As a test, I tried adding another dummy menu time after the grid row, which renders correctly (in black background), but doesn't seem to fix the rest of the unfilled white space below the last menu.

Screenshot:
screenshot_1007

Any suggestions on what to try would be appreciated.

@davetcc
Copy link
Collaborator Author

davetcc commented Apr 15, 2023

Closing this issue now, and leaving the library issue open

@davetcc davetcc closed this as completed Apr 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant