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

Add black background to detail text in character dropdown #8487

Merged
merged 2 commits into from
Feb 20, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion src/Classes/DropDownControl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,19 @@ function DropDownClass:Draw(viewPort, noTooltip)
DrawString(0, 0, "LEFT", lineHeight, "VAR", selLabel or "")
if selDetail ~= nil then
local dx = DrawStringWidth(lineHeight, "VAR", selDetail)
if not enabled or self.dropped then
SetDrawColor(0, 0, 0)
elseif mOver then
SetDrawColor(0.33, 0.33, 0.33)
else
SetDrawColor(0, 0, 0)
end
DrawImage(nil, width - dx - 4 - 22, 0, width - 4, lineHeight)
if enabled then
SetDrawColor(1, 1, 1)
else
SetDrawColor(0.66, 0.66, 0.66)
end
DrawString(width - dx - 22, 0, "LEFT", lineHeight, "VAR", selDetail)
end
SetViewport()
Expand Down Expand Up @@ -378,7 +391,19 @@ function DropDownClass:Draw(viewPort, noTooltip)
DrawString(0, y, "LEFT", lineHeight, "VAR", label)
if detail ~= nil then
local detail = listVal.detail
dx = DrawStringWidth(lineHeight, "VAR", detail)
local dx = DrawStringWidth(lineHeight, "VAR", detail)
if index == self.hoverSel then
SetDrawColor(0.33, 0.33, 0.33)
else
SetDrawColor(0, 0, 0)
end
DrawImage(nil, width - dx - 8 - 22, y, width - 4, lineHeight)
-- highlight font color if hovered or selected
if index == self.hoverSel or index == self.selIndex then
SetDrawColor(1, 1, 1)
else
SetDrawColor(0.66, 0.66, 0.66)
end
DrawString(width - dx - 4 - 22, y, "LEFT", lineHeight, "VAR", detail)
end
self:DrawSearchHighlights(label, searchInfo, 0, y, width - 4, lineHeight)
Expand Down