Scrollbar improvements
glassleo opened this issue ยท 0 comments
So on AH mules and similar the same thing that is the biggest improvement for Inbox (scrollable, mouse-scrollable) is also a problem because it's hard to see which ones you've already mouse-overed when you scroll.
You can always use the up/down buttons on the scrollbar to scroll by a fixed amount but I thought it would be convenient to have a visual indicator of your current offset for you when you're using the scrollwheel to scroll.
So I added the scroll offset to the scrollbar thumb
The code to do this is in 2 places.
In the embedded tekScrollbar.lua file the section starting line 62 changed to
f:SetThumbTexture("Interface\\Buttons\\UI-ScrollBar-Knob")
local thumb = f:GetThumbTexture()
thumb:SetWidth(16) thumb:SetHeight(24)
thumb:SetTexCoord(1/4, 3/4, 1/8, 7/8)
local ofs = f:CreateFontString(nil, "OVERLAY", "GameFontWhiteTiny")
local font,h = ofs:GetFont(); h = floor(h+0.5)
ofs:SetFont(font,h,"OUTLINE")
ofs:SetAllPoints(thumb)
f.offset = ofs
In GnomishInboxShrinker.lua updating the BetterInbox:UpdateInboxScroll() to
function BetterInbox:UpdateInboxScroll()
if self.scroll then
local numitems = GetInboxNumItems()
local offset = self.scroll:GetValue()
self.scroll:SetMinMaxValues(0, math.max(0, numitems-NUMROWS))
for i,row in pairs(rows) do
local index = i + offset
if index <= numitems then row:Update(index)
else row:Hide() end
end
self.scroll.offset:SetText(format("%02d",tostring(offset)))
end
end
Originally posted by @Road-block in #1 (comment)