Absolutely no idea how to recolor headings in DListView
2 replies, posted
I have no idea where to start, I don't know what I'm looking for in the SKINS files, looking at [url]https://github.com/garrynewman/garrysmod/blob/master/garrysmod/lua/vgui/dlistview.lua[/url] has not helped me at all because I have no idea what am I looking for in order to change it.
Right now this is what it looks like:
[url]http://i.imgur.com/R14ZKRB.png[/url]
Can anyone point me in the right direction? I also want to center the text as well.
When calling AddColumn on your ListView, the column element (of type DListView_Column) is returned. It has a Header property which is defined to the label showing the text you want changed.
tl;dr use the SetTextColor metamethod on the object returned's Header property when adding a column with AddColumn
Example:
[lua]
local mycolumn = ListView:AddColumn("My Column")
mycolumn.Header:SetTextColor(Color(0,0,0))
[/lua]
Untested but should work from what I can see in the files
[lua]
function SKIN:LayoutListViewHeaderLabel(panel)
panel:SetContentAlignment(5)
end
function SKIN:PaintListViewHeaderLabel(panel, w, h)
surface.SetDrawColor( 255, 255, 0 )
surface.DrawRect(0, 0, w, h)
end
[/lua]
untested
Sorry, you need to Log In to post a reply to this thread.