Ok so I figured out how to achieve this effect (Mono C#).
Attach a script to your tree
Add a TreeItem var.
TreeItem hover
Declare a trigger for both mouseentered and mouseexited:
Connect("mouse_entered",this,"Mouse_Entered");
Connect("mouse_exited",this,"Mouse_Exited");
If other unrelated code exists in the _process function add a bool and swap its state in these triggers. In my case the process only has one purpose so I enabled/disable the function.
private void Mouse_Entered(){
SetProcess(true);
}
private void Mouse_Exited(){
SetProcess(false);
}
Then add this to process: (use a bool check if not needed).
public override void _Process(float delta)
{
TreeItem temp = GetItemAtPosition(GetLocalMousePosition());
if (temp != hover){
for (int i = 0; i < Columns; i++)
{
if (hover != null) hover.ClearCustomColor(i);
if (temp != null) temp.SetCustomColor(i, Colors.Red);
}
hover = temp;
}
}