From 21e027ad80fafba02d20c26f611d4379ce0bf990 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Thu, 9 Mar 2023 22:24:32 -0500 Subject: [PATCH] When drawing Tooltip, use tooltipTheme.textColor instead of menuTheme. Set tooltipTheme to fg color for all UI themes. --- src/ui/Tooltip.cpp | 7 +++++++ src/ui/common.cpp | 1 + 2 files changed, 8 insertions(+) diff --git a/src/ui/Tooltip.cpp b/src/ui/Tooltip.cpp index 78b25b13..c90a5d7d 100644 --- a/src/ui/Tooltip.cpp +++ b/src/ui/Tooltip.cpp @@ -26,7 +26,14 @@ void Tooltip::step() { void Tooltip::draw(const DrawArgs& args) { bndTooltipBackground(args.vg, 0.0, 0.0, box.size.x, box.size.y); nvgTextLineHeight(args.vg, 1.2); + + // Because there is no bndThemeLabel() function, temporarily replace the menu text color with tooltip text color and draw a menu label + BNDtheme* theme = (BNDtheme*) bndGetTheme(); + NVGcolor menuTextColor = theme->menuTheme.textColor; + theme->menuTheme.textColor = theme->tooltipTheme.textColor; bndMenuLabel(args.vg, 0.0, 0.0, INFINITY, box.size.y, -1, text.c_str()); + theme->menuTheme.textColor = menuTextColor; + Widget::draw(args); } diff --git a/src/ui/common.cpp b/src/ui/common.cpp index 8fb5b337..b49cdeeb 100644 --- a/src/ui/common.cpp +++ b/src/ui/common.cpp @@ -67,6 +67,7 @@ void setTheme(NVGcolor bg, NVGcolor fg) { // Tooltip background t.tooltipTheme.innerColor = bg; + t.tooltipTheme.textColor = fg; bndSetTheme(t); }