From ab712cd5c86ad751cd8141c968cfeffb76aa6c80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Mon, 27 Apr 2026 16:48:31 -0300 Subject: [PATCH] Correctly set HTML img alt text color. --- src/eepp/ui/uihtmlimage.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/eepp/ui/uihtmlimage.cpp b/src/eepp/ui/uihtmlimage.cpp index 75f407b64..75aa01edc 100644 --- a/src/eepp/ui/uihtmlimage.cpp +++ b/src/eepp/ui/uihtmlimage.cpp @@ -4,7 +4,9 @@ #include #include +#include #include +#include #include #include @@ -49,7 +51,20 @@ void UIHTMLImage::draw() { FontStyleConfig fontStyleConfig; fontStyleConfig.Font = themeManager->getDefaultFont(); fontStyleConfig.CharacterSize = themeManager->getDefaultFontSize(); - fontStyleConfig.FontColor = Color( 128, 128, 128, mAlpha ); + + Color fontColor = Color::White; + Node* parent = mParentNode; + while ( parent ) { + if ( parent->isWidget() ) { + auto* w = parent->asType(); + if ( w->isType( UI_TYPE_RICHTEXT ) ) { + fontColor = static_cast( w )->getFontColor(); + break; + } + } + parent = parent->getParent(); + } + fontStyleConfig.FontColor = Color( fontColor.r, fontColor.g, fontColor.b, mAlpha ); Float textWidth = Text::getTextWidth( mAlt, fontStyleConfig ); Float availableWidth = mSize.getWidth() - mPaddingPx.Left - mPaddingPx.Right;