This is a bit hacky as it directly modifies kgPanels' DB, but it should work.
Just add this to the OnClick script of the panel:
lua Code:
SlashCmdList.REFLUX("switch MyProfile")
self:Hide()
local layout = kgPanels.db.global.layouts[kgPanels.active] -- Fetch the current layout
for name, data in pairs(layout) do -- Search for the name/data of this frame
if kgPanels:FetchFrame(name) == self then -- We've found this frame
data.scripts.LOAD = "self:Hide()" -- Replace the OnLoad script
data.scripts.CLICK = "" -- Replace the OnClick script
end
end
Change MyProfile on the first line to the name of the Reflux profile you want to switch to.
This may not work if your characters use the same kgPanels layout.
If the Reflux profile switches to a kgPanels layout without this button, you should be able to get rid of everything past the first two lines.