@@ -91,15 +91,18 @@ ScrollFrame.defineProperty(ScrollFrame, "showScrollBar", {default = true, type =
9191--- @property scrollBarSymbol string "_" The symbol used for the scrollbar handle
9292ScrollFrame .defineProperty (ScrollFrame , " scrollBarSymbol" , {default = " " , type = " string" , canTriggerRender = true })
9393
94- --- @property scrollBarBackground string "\127" The symbol used for the scrollbar background
95- ScrollFrame .defineProperty (ScrollFrame , " scrollBarBackground " , {default = " \127 " , type = " string" , canTriggerRender = true })
94+ --- @property scrollBarBackgroundSymbol string "\127" The symbol used for the scrollbar background
95+ ScrollFrame .defineProperty (ScrollFrame , " scrollBarBackgroundSymbol " , {default = " \127 " , type = " string" , canTriggerRender = true })
9696
9797--- @property scrollBarColor color lightGray Color of the scrollbar handle
9898ScrollFrame .defineProperty (ScrollFrame , " scrollBarColor" , {default = colors .lightGray , type = " color" , canTriggerRender = true })
9999
100100--- @property scrollBarBackgroundColor color gray Background color of the scrollbar
101101ScrollFrame .defineProperty (ScrollFrame , " scrollBarBackgroundColor" , {default = colors .gray , type = " color" , canTriggerRender = true })
102102
103+ --- @property scrollBarBackgroundColor2 secondary color black Background color of the scrollbar
104+ ScrollFrame .defineProperty (ScrollFrame , " scrollBarBackgroundColor2" , {default = colors .black , type = " color" , canTriggerRender = true })
105+
103106--- @property contentWidth number 0 The total width of the content (calculated from children)
104107ScrollFrame .defineProperty (ScrollFrame , " contentWidth" , {
105108 default = 0 ,
@@ -378,20 +381,19 @@ function ScrollFrame:render()
378381 local scrollHeight = viewportHeight
379382 local handleSize = math.max (1 , math.floor ((viewportHeight / contentHeight ) * scrollHeight ))
380383 local maxOffset = contentHeight - viewportHeight
381- local scrollBarSymbol = self .get (" scrollBarSymbol" )
382- local scrollBarBg = self .get (" scrollBarBackground" )
384+ local scrollBarBg = self .get (" scrollBarBackgroundSymbol" )
383385 local scrollBarColor = self .get (" scrollBarColor" )
384386 local scrollBarBgColor = self .get (" scrollBarBackgroundColor" )
385- local foreground = self .get (" foreground " )
387+ local scrollBarBg2Color = self .get (" scrollBarBackgroundColor2 " )
386388
387389 local currentPercent = maxOffset > 0 and (offsetY / maxOffset * 100 ) or 0
388390 local handlePos = math.floor ((currentPercent / 100 ) * (scrollHeight - handleSize )) + 1
389391
390392 for i = 1 , scrollHeight do
391393 if i >= handlePos and i < handlePos + handleSize then
392- self :blit (width , i , scrollBarSymbol , tHex [scrollBarColor ], tHex [scrollBarBgColor ])
394+ self :blit (width , i , " " , tHex [scrollBarColor ], tHex [scrollBarColor ])
393395 else
394- self :blit (width , i , scrollBarBg , tHex [foreground ], tHex [scrollBarBgColor ])
396+ self :blit (width , i , scrollBarBg , tHex [scrollBarBgColor ], tHex [scrollBarBg2Color ])
395397 end
396398 end
397399 end
@@ -400,20 +402,19 @@ function ScrollFrame:render()
400402 local scrollWidth = viewportWidth
401403 local handleSize = math.max (1 , math.floor ((viewportWidth / contentWidth ) * scrollWidth ))
402404 local maxOffset = contentWidth - viewportWidth
403- local scrollBarSymbol = self .get (" scrollBarSymbol" )
404- local scrollBarBg = self .get (" scrollBarBackground" )
405+ local scrollBarBg = self .get (" scrollBarBackgroundSymbol" )
405406 local scrollBarColor = self .get (" scrollBarColor" )
406407 local scrollBarBgColor = self .get (" scrollBarBackgroundColor" )
407- local foreground = self .get (" foreground " )
408+ local scrollBarBg2Color = self .get (" scrollBarBackgroundColor2 " )
408409
409410 local currentPercent = maxOffset > 0 and (offsetX / maxOffset * 100 ) or 0
410411 local handlePos = math.floor ((currentPercent / 100 ) * (scrollWidth - handleSize )) + 1
411412
412413 for i = 1 , scrollWidth do
413414 if i >= handlePos and i < handlePos + handleSize then
414- self :blit (i , height , scrollBarSymbol , tHex [scrollBarColor ], tHex [scrollBarBgColor ])
415+ self :blit (i , height , " " , tHex [scrollBarColor ], tHex [scrollBarColor ])
415416 else
416- self :blit (i , height , scrollBarBg , tHex [foreground ], tHex [scrollBarBgColor ])
417+ self :blit (i , height , scrollBarBg , tHex [scrollBarBgColor ], tHex [scrollBarBg2Color ])
417418 end
418419 end
419420 end
0 commit comments