DPropertySheet PANEL.Paint the actual tabs

Is it possible to color the actual tabs of a DPropertySheet?

Bump, I’ve always wondered this :zoid:

Nope, not that i know of. The only way I know how to get those buttons colored is if your using gwen… or a derma skin.

Yes you can color the tabs. I’ll post the code in a second.
[lua]
for k, v in pairs(PropertySheet.Items) do
if (!v.Tab) then continue end

v.Tab.Paint = function(self,w,h)
	draw.RoundedBox(0, 0, 0, w, h, Color(math.random(0,255),0,0))
end

end
[/lua]

anyway to change the color when the tab is selected or not selected?



for k, v in pairs(PropertySheet.Items) do
    if (!v.Tab) then continue end
    
    v.Tab.Paint = function(self,w,h)
         draw.RoundedBox(0, 0, 0, w, h, Color(math.random(0,255),0,0))
         if v.Tab:IsDown() then
            draw.RoundedBox( 0, 2, 2, w - 4, h - 4, Color( 0, 0, 0, 100 ) )
        end
    end
end


Try this?

only works when you are holding down the mouse on that tab, otherwise it returns to normal (even when active) would v.Tab:IsActiveTab() work?

[editline]l[/editline]

nvm, I used v.Tab == tabs:GetActiveTab() and it worked.

Just try it yourself…