From 597a66ec9cb2e084cafbac3f991566bf0fa1cd07 Mon Sep 17 00:00:00 2001 From: Vati Date: Sat, 28 Feb 2026 04:30:18 +0400 Subject: [PATCH] fix: category counter disable when only 1 item in category --- UI/BagFrame.lua | 2 +- UI/BankFrame.lua | 4 ++-- UI/FrameHelpers.lua | 8 ++++++++ UI/SettingsPopup.lua | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/UI/BagFrame.lua b/UI/BagFrame.lua index d7552e8..c01f952 100644 --- a/UI/BagFrame.lua +++ b/UI/BagFrame.lua @@ -1079,7 +1079,7 @@ function BagFrame:DisplayItemsByCategory(bagData, isOtherChar, charName) if header.countText then local showCount = addon.Modules.DB:GetSetting("showCategoryCount") if showCount == nil then showCount = true end - if showCount and numItems > 0 then + if showCount and numItems > 1 then header.countText:SetText("(" .. numItems .. ")") header.countText:Show() else diff --git a/UI/BankFrame.lua b/UI/BankFrame.lua index 5fd8e34..193f2c6 100644 --- a/UI/BankFrame.lua +++ b/UI/BankFrame.lua @@ -884,7 +884,7 @@ function BankFrame:DisplayItemsByCategory(bankData, isOtherChar, charName) if header.countText then local showCount = addon.Modules.DB:GetSetting("showCategoryCount") if showCount == nil then showCount = true end - if showCount and numItems > 0 then + if showCount and numItems > 1 then header.countText:SetText("(" .. numItems .. ")") header.countText:Show() else @@ -1003,7 +1003,7 @@ function BankFrame:DisplayItemsByCategory(bankData, isOtherChar, charName) if header.countText then local showCount = addon.Modules.DB:GetSetting("showCategoryCount") if showCount == nil then showCount = true end - if showCount and numItems > 0 then + if showCount and numItems > 1 then header.countText:SetText("(" .. numItems .. ")") header.countText:Show() else diff --git a/UI/FrameHelpers.lua b/UI/FrameHelpers.lua index aa4d322..ec68222 100644 --- a/UI/FrameHelpers.lua +++ b/UI/FrameHelpers.lua @@ -279,6 +279,14 @@ function Guda_GetSectionHeader(framePrefix, containerName, index) countText:SetTextColor(0.6, 0.6, 0.6) header.countText = countText + -- Separator line extending from count/text to the right edge + local line = header:CreateTexture(nil, "ARTWORK") + line:SetHeight(1) + line:SetPoint("LEFT", countText, "RIGHT", 6, 0) + line:SetPoint("RIGHT", header, "RIGHT", 0, 0) + line:SetTexture(0.6, 0.6, 0.6, 0.3) + header.separatorLine = line + header:SetScript("OnEnter", function() if this.fullName and this.isShortened then GameTooltip:SetOwner(this, "ANCHOR_TOP") diff --git a/UI/SettingsPopup.lua b/UI/SettingsPopup.lua index f90e82e..7943e87 100644 --- a/UI/SettingsPopup.lua +++ b/UI/SettingsPopup.lua @@ -18,7 +18,7 @@ local function CreateSectionHeader(parent, text, yOffset) line:SetHeight(1) line:SetPoint("LEFT", label, "RIGHT", 8, 0) line:SetPoint("RIGHT", parent, "RIGHT", -5, 0) - line:SetTexture(1, 0.82, 0, 0.3) + line:SetTexture(0.6, 0.6, 0.6, 0.3) return label end