Skip to content

Commit 21bd407

Browse files
committed
Refined label highlighting behavior and focused text color handling.
1 parent d489245 commit 21bd407

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

external/rlguipp/rlguipp.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2744,12 +2744,14 @@ void System::drawItem(Item const& item, Rectangle bounds, bool hovered) const {
27442744
}
27452745

27462746
Color textCol = GetColor(GetStyle(LABEL, item.enabled ? TEXT_COLOR_NORMAL : TEXT_COLOR_DISABLED));
2747+
Color highlightCol = GetColor(GetStyle(LABEL, TEXT_COLOR_FOCUSED));
27472748
Color shortcutCol = textCol;
27482749

27492750
// Hover highlight
27502751
if (hovered && item.enabled) {
27512752
DrawRectangleRec(bounds, GetColor(GetStyle(DEFAULT, BASE_COLOR_FOCUSED)));
27522753
textCol = GetColor(GetStyle(LABEL, TEXT_COLOR_FOCUSED));
2754+
highlightCol = GetColor(GetStyle(LABEL, BASE_COLOR_NORMAL));
27532755
shortcutCol = textCol;
27542756
}
27552757

@@ -2770,7 +2772,7 @@ void System::drawItem(Item const& item, Rectangle bounds, bool hovered) const {
27702772
DrawTextClipped(font, parts.path.c_str(), Vector2(labelXPos, textYPos), textCol);
27712773
labelXPos += calculateTextWidth(parts.path);
27722774
}
2773-
DrawTextClipped(font, parts.filename.c_str(), Vector2(labelXPos, textYPos), GetColor(GetStyle(LABEL, TEXT_COLOR_FOCUSED)));
2775+
DrawTextClipped(font, parts.filename.c_str(), Vector2(labelXPos, textYPos), highlightCol);
27742776
}
27752777
else {
27762778
DrawTextClipped(font, item.label.c_str(), Vector2(labelXPos, textYPos), textCol);

0 commit comments

Comments
 (0)