Skip to content
Open
Show file tree
Hide file tree
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
20 changes: 20 additions & 0 deletions AceGUI/ChoreLabel.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
local AceGUI = LibStub('AceGUI-3.0')
local Type, Version = 'ChoreLabel', 1

local parentType = 'Label' -- Inherit from this
local parentProto = AceGUI.WidgetRegistry[parentType]

local function Constructor()
local widget = parentProto()
widget.type = Type

local baseOnAcquire = widget.OnAcquire
widget.OnAcquire = function(self)
baseOnAcquire(self)
self.label:SetWordWrap(false)
end

return AceGUI:RegisterAsWidget(widget)
end

AceGUI:RegisterWidgetType(Type, Constructor, Version)
1 change: 1 addition & 0 deletions ChoreTracker.toc
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Libs\LibDataBroker-1.1\LibDataBroker-1.1.lua
Libs\LibDBIcon-1.0\LibDBIcon-1.0.lua

AceGUI\ChoreFrame.lua
AceGUI\ChoreLabel.lua
AceGUI\FancyList.lua
AceGUI\LabelWithButton.lua

Expand Down
9 changes: 6 additions & 3 deletions Modules/Display.lua
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ function Module:OnEnable()
}, 1, 'ConfigChanged')
self:RegisterBucketEvent({ 'ITEM_DATA_LOAD_RESULT' }, 1, 'ItemsLoaded')

self.lineFontObject = CreateFont('ChoreTrackerLineFont')

self:CreateMainFrame()
self:UpdateShown()
self:Redraw()
Expand Down Expand Up @@ -201,6 +203,7 @@ end

function Module:ConfigChanged()
self.font = LSM:Fetch('font', Addon.db.profile.general.text.font)
self.lineFontObject:SetFont(self.font, Addon.db.profile.general.text.fontSize, Addon.db.profile.general.text.fontStyle)

self.frame.frame:SetFrameStrata(Addon.db.profile.general.appearance.strata)
self.frame:SetBackgroundColor(Addon.db.profile.general.appearance.backgroundColor)
Expand Down Expand Up @@ -1154,10 +1157,10 @@ function Module:ObjectiveText(objective, questName)
end

function Module:AddLine(frame, text, size, waypointFunc)
local label = AceGUI:Create('Label')
label:SetFont(self.font, size or Addon.db.profile.general.text.fontSize, Addon.db.profile.general.text.fontStyle)
local label = AceGUI:Create('ChoreLabel')
label:SetFontObject(self.lineFontObject)
if size then label.label:SetFontHeight(size) end
label:SetText(text)
label.label:SetWordWrap(false)

if waypointFunc ~= nil then
local rowGroup = AceGUI:Create('SimpleGroup')
Expand Down