Skip to content

TextMenu TitleForegroundColor and TitleBackgroundColorcolors ignored again in DrawTitle #109

@RobinClaesson

Description

@RobinClaesson

private void DrawTitle(ControlDisplay display)

This was previously reported and fixed in #48 but it looks to be back in the latest release.
In the main branch the DrawTitle() for TextMenu is back to

display.WriteRow(TitleText);

instead of the expected

display.WriteRow(TitleForegroundColor, TitleBackgroundColor, TitleText);

added in The fix.

Overriding the function like this created a hotfix in my program, so it looks like it is the same issue.

protected override void DoDisplayContent(ControlDisplay display)
{
    // Save the original title text and set it to null to prevent it from being displayed twice
    var titleText = TitleText;
    TitleText = null;

    // Fixed display of the title text with the color settings back
    if (titleText != null)
        display.WriteRow(TitleForegroundColor, TitleBackgroundColor, titleText);

    base.DoDisplayContent(display);
    titleText = TitleText; // Restore the title text
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions