Skip to content

Commit 6450a7d

Browse files
committed
Fix cvar browser scrollbar arrow buttons being disabled on load
1 parent 760abd6 commit 6450a7d

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

semlib/widgets.lua

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,18 @@ local function updatescroll(scroll)
5959
end
6060
end
6161

62+
-- Disable scrollbar arrow buttons when at top or bottom of list
63+
local scrollbar = scroll.scrollbar
64+
if scroll.value == scroll.minValue then
65+
scrollbar.ScrollUpButton:Disable()
66+
else
67+
scrollbar.ScrollUpButton:Enable()
68+
end
69+
if scroll.value >= scroll.maxValue then
70+
scrollbar.ScrollDownButton:Disable()
71+
else
72+
scrollbar.ScrollDownButton:Enable()
73+
end
6274
--scroll.scrollbar:SetValue(scroll.value)
6375
end
6476

@@ -252,19 +264,10 @@ function addon:CreateListFrame(parent, w, h, cols)
252264
scrollbar.ScrollDownButton:SetScript("OnClick", function()
253265
scroll(frame, -1)
254266
end)
267+
255268
scrollbar:SetScript("OnValueChanged", function(self, value)
256269
frame.value = floor(value)
257270
frame:Update()
258-
if frame.value == frame.minValue then
259-
self.ScrollUpButton:Disable()
260-
else
261-
self.ScrollUpButton:Enable()
262-
end
263-
if frame.value >= frame.maxValue then
264-
self.ScrollDownButton:Disable()
265-
else
266-
self.ScrollDownButton:Enable()
267-
end
268271
end)
269272
frame.scrollbar = scrollbar
270273

0 commit comments

Comments
 (0)