From f304c98ce815b57d22be04291b56ce0e4d295590 Mon Sep 17 00:00:00 2001 From: Sabine Lim Date: Tue, 16 May 2023 02:54:55 +1000 Subject: [PATCH] Update Scrollbar --- Basalt/objects/Scrollbar.lua | 32 ++++++++++++++++++++++++++++++++ Basalt/plugins/xml.lua | 4 ++-- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/Basalt/objects/Scrollbar.lua b/Basalt/objects/Scrollbar.lua index 5b2ad8e..63ecf94 100644 --- a/Basalt/objects/Scrollbar.lua +++ b/Basalt/objects/Scrollbar.lua @@ -62,6 +62,26 @@ return function(name, basalt) return self end, + setSymbolBG = function(self, bg) + return self:setSymbol(symbol, bg, nil) + end, + + setSymbolFG = function(self, fg) + return self:setSymbol(symbol, nil, fg) + end, + + getSymbol = function(self) + return symbol + end, + + getSymbolBG = function(self) + return symbolBG + end, + + getSymbolFG = function(self) + return symbolFG + end, + setIndex = function(self, _index) index = _index if (index < 1) then @@ -81,6 +101,10 @@ return function(name, basalt) return self end, + getScrollAmount = function(self) + return scrollAmount + end, + getIndex = function(self) local w,h = self:getSize() return scrollAmount > (barType=="vertical" and h or w) and math.floor(scrollAmount/(barType=="vertical" and h or w) * index) or index @@ -94,6 +118,10 @@ return function(name, basalt) return self end, + getSymbolSize = function(self) + return symbolSize + end, + setBarType = function(self, _typ) barType = _typ:lower() updateSymbolSize() @@ -101,6 +129,10 @@ return function(name, basalt) return self end, + getBarType = function(self) + return barType + end, + mouseHandler = function(self, button, x, y, ...) if (base.mouseHandler(self, button, x, y, ...)) then mouseEvent(self, button, x, y) diff --git a/Basalt/plugins/xml.lua b/Basalt/plugins/xml.lua index 5d0ee5b..ff46b76 100644 --- a/Basalt/plugins/xml.lua +++ b/Basalt/plugins/xml.lua @@ -590,11 +590,11 @@ return { base.setValuesByXMLData(self, data, renderContext) self:updateSpecifiedValuesByXMLData(data, { "symbol", - "symbolColor", + "symbolBG", + "symbolFG", "symbolSize", "scrollAmount", "index", - "maxValue", "barType" }) return self