From d57b799c052c9424649eb3651e6774ac62dd6855 Mon Sep 17 00:00:00 2001 From: tflo Date: Thu, 3 Sep 2026 23:34:51 +0200 Subject: [PATCH 1/2] Fix leaking wordwrap setting Register separate widget for the lines --- AceGUI/ChoreLabel.lua | 20 ++++++++++++++++++++ ChoreTracker.toc | 1 + Modules/Display.lua | 3 +-- 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 AceGUI/ChoreLabel.lua diff --git a/AceGUI/ChoreLabel.lua b/AceGUI/ChoreLabel.lua new file mode 100644 index 0000000..96aecf2 --- /dev/null +++ b/AceGUI/ChoreLabel.lua @@ -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) diff --git a/ChoreTracker.toc b/ChoreTracker.toc index 124054b..22471c8 100644 --- a/ChoreTracker.toc +++ b/ChoreTracker.toc @@ -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 diff --git a/Modules/Display.lua b/Modules/Display.lua index 649879c..a08dfbe 100644 --- a/Modules/Display.lua +++ b/Modules/Display.lua @@ -1154,10 +1154,9 @@ function Module:ObjectiveText(objective, questName) end function Module:AddLine(frame, text, size, waypointFunc) - local label = AceGUI:Create('Label') + local label = AceGUI:Create('ChoreLabel') label:SetFont(self.font, size or Addon.db.profile.general.text.fontSize, Addon.db.profile.general.text.fontStyle) label:SetText(text) - label.label:SetWordWrap(false) if waypointFunc ~= nil then local rowGroup = AceGUI:Create('SimpleGroup') From f989ceb284dbf6168cc8f4fbad6d82a56a567c79 Mon Sep 17 00:00:00 2001 From: tflo Date: Thu, 3 Sep 2026 23:36:55 +0200 Subject: [PATCH 2/2] Optimize fontstring construction for `AddLine` --- Modules/Display.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Modules/Display.lua b/Modules/Display.lua index a08dfbe..6e3a7a2 100644 --- a/Modules/Display.lua +++ b/Modules/Display.lua @@ -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() @@ -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) @@ -1155,7 +1158,8 @@ end function Module:AddLine(frame, text, size, waypointFunc) local label = AceGUI:Create('ChoreLabel') - label:SetFont(self.font, size or Addon.db.profile.general.text.fontSize, Addon.db.profile.general.text.fontStyle) + label:SetFontObject(self.lineFontObject) + if size then label.label:SetFontHeight(size) end label:SetText(text) if waypointFunc ~= nil then