Skip to content

Commit

Permalink
Used custom font strings for index buttons.
Browse files Browse the repository at this point in the history
  • Loading branch information
Cidan committed Sep 7, 2024
1 parent e12cdb5 commit 852e4df
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions forms/layouts/stacked.lua
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,18 @@ function stackedLayout:addIndex(title, point, sub)
local indexButton = CreateFrame("Button", nil, self.indexFrame) --[[@as Button]]
indexButton:SetSize(100, 24)
if sub then
indexButton:SetNormalFontObject("GameFontNormal")
local font = indexButton:CreateFontString(nil, "OVERLAY", "GameFontNormal")
indexButton:SetFontString(font)
else
indexButton:SetNormalFontObject("GameFontNormalLarge")
local font = indexButton:CreateFontString(nil, "OVERLAY", "GameFontNormalLarge")
indexButton:SetFontString(font)
end
local fs = indexButton:GetNormalFontObject()
indexButton:SetText(sub and " " .. title or title)
local fs = indexButton:GetFontString()
fs:SetTextColor(1, 1, 1)
fs:ClearAllPoints()
fs:SetPoint("LEFT", indexButton, "LEFT", 5, 0)
fs:SetJustifyH("LEFT")
indexButton:SetText(sub and " " .. title or title)

indexButton:SetScript("OnClick", function()
local targetTop = point:GetTop()
Expand Down

0 comments on commit 852e4df

Please sign in to comment.