godotengine / godotengine/godot

TreeItem.set_custom_as_button doesn't make TreeItem behave as Stylebox

Open
#98,690 1 comment 1 reaction 0 assignees View on GitHub
bug topic:gui
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

Reproducible in 4.3.1.rc

### System information

Windows 10

### Issue description

Custom Button Styles are set in Tree but they take no effect.
![image](https://github.com/user-attachments/assets/abfda20a-f8fe-4684-b248-ae1b650f45c3)

Result:
![image](https://github.com/user-attachments/assets/a6defd60-87ff-47a7-bd6d-2481356a3fb8)

### Steps to reproduce

```
extends Tree
@onready var tree: Tree = $"."

func _ready() -> void:
var child := tree.create_item().create_child()
child.set_cell_mode(0, TreeItem.CELL_MODE_CUSTOM)
child.set_custom_as_button(0, true)
child.set_text(0, "This is text")
```

### Minimal reproduction project (MRP)

[custom_as_button_mrp.zip](https://github.com/user-attachments/files/17582231/custom_as_button_mrp.zip)

two files here with Styles set

Contributor guide

Open the contributing guide

Research direction

Start by running the attached custom_as_button_mrp.zip project and reproducing the behavior with the provided Tree and TreeItem GDScript. Trace the TreeItem custom-cell and style handling to determine why set_custom_as_button has no visible effect; done means the configured custom button styles are applied to the TreeItem.

Written by the indexing model from the issue text.

Assessment

Tech stack
godot
Domain
game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.