I tried it, but I found it was impossible without modifying the actual widget code. In widget_switch.lua around line 740 or so,
if "onOff" == opt.switchType then
there are a bunch of lines that set opt.OnOff frames from the customOptions table. So for example:
opt.onOffBackgroundFrame = customOptions.backgroundFrame or themeOptions.backgroundFrame
The customOptions table has keys starting with onOff, but this block doesn’t, so it fails. It should be:
opt.onOffBackgroundFrame = customOptions.onOffBackgroundFrame or themeOptions.backgroundFrame
Furthermore, within that block, there are typos where default is typed “defualt”
Also, in method “createOnOffSwitch()” there is the following block of code that checks if opt.themeData is set, and if so, sets all the frame variables to theme frames. Otherwise, it should set them to the custom frames:
if opt.themeData then local themeData = require( opt.themeData ) offFrame = themeData:getFrameIndex( opt.onOffHandleDefaultFrame ) onFrame = themeData:getFrameIndex( opt.onOffHandleOverFrame ) backgroundFrame = themeData:getFrameIndex( opt.onOffBackgroundFrame ) overlayFrame = themeData:getFrameIndex( opt.onOffOverlayFrame ) else print("else") offFrame = opt.onOffHandleDefaultFrame onFrame = opt.onOffHandleOverFrame backgroundFrame = opt.onOffBackgroundFrame overlayFrame = opt.onOffOverlayFrame end
However, opt.themeData will always be set at this point, so custom frames are never set. It should be a conditional based on whether custom frames exist. I changed the conditional to this:
if not opt.onOffHandleDefaultFrame then local themeData = require( opt.themeData ) offFrame = themeData:getFrameIndex( opt.onOffHandleDefaultFrame ) onFrame = themeData:getFrameIndex( opt.onOffHandleOverFrame ) backgroundFrame = themeData:getFrameIndex( opt.onOffBackgroundFrame ) overlayFrame = themeData:getFrameIndex( opt.onOffOverlayFrame ) else print("else") offFrame = opt.onOffHandleDefaultFrame onFrame = opt.onOffHandleOverFrame backgroundFrame = opt.onOffBackgroundFrame overlayFrame = opt.onOffOverlayFrame end
This seems to have done the trick; however, I have not tested it using the default switch (only with my custom imagesheet).