Skip to content

GD-1076: Replace Tree-based hook rendering with VBoxContainer row template#1083

Merged
MikeSchulze merged 2 commits intomasterfrom
GD-1076
Mar 20, 2026
Merged

GD-1076: Replace Tree-based hook rendering with VBoxContainer row template#1083
MikeSchulze merged 2 commits intomasterfrom
GD-1076

Conversation

@MikeSchulze
Copy link
Copy Markdown
Collaborator

@MikeSchulze MikeSchulze commented Mar 20, 2026

Why

The custom Tree widget required manual draw_* calls for every visual
element (text, badges, borders, selection highlight). This approach was
fragile and produced rendering artifacts that were difficult to fix and
maintain across different editor themes.

What

  • Replaced the Tree node with a VBoxContainer (hook_list) populated at runtime by duplicating a hidden row_template Panel
  • Each row uses standard Godot controls: ColorRect (indicator bar), Label (hook name), PanelContainer/Label (SYSTEM badge), and CheckButton (enable toggle)
  • Selection state is tracked via a _selected_row reference and a StyleBoxFlat border overlay instead of TreeItem selection
  • Move-up/down and delete operations now use VBoxContainer.move_child() and queue_free() instead of TreeItem API
  • Added _update_focus_relations() to wire keyboard navigation between rows

New look:

  • Delfault Theme
image
  • Light Theme
image

…plate

 # Why
  The custom `Tree` widget required manual `draw_*` calls for every visual
  element (text, badges, borders, selection highlight). This approach was
  fragile and produced rendering artifacts that were difficult to fix and
  maintain across different editor themes.

  # What
  - Replaced the `Tree` node with a `VBoxContainer` (`hook_list`) populated
    at runtime by duplicating a hidden `row_template` Panel
  - Each row uses standard Godot controls: `ColorRect` (indicator bar),
    `Label` (hook name), `PanelContainer`/`Label` (SYSTEM badge), and
    `CheckButton` (enable toggle)
  - Selection state is tracked via a `_selected_row` reference and a
    `StyleBoxFlat` border overlay instead of `TreeItem` selection
  - Move-up/down and delete operations now use `VBoxContainer.move_child()`
    and `queue_free()` instead of `TreeItem` API
  - Added `_update_focus_relations()` to wire keyboard navigation between rows
@MikeSchulze MikeSchulze self-assigned this Mar 20, 2026
@MikeSchulze MikeSchulze linked an issue Mar 20, 2026 that may be closed by this pull request
@MikeSchulze MikeSchulze added the bug Something isn't working label Mar 20, 2026
@MikeSchulze MikeSchulze merged commit 3ff9514 into master Mar 20, 2026
15 checks passed
@MikeSchulze MikeSchulze deleted the GD-1076 branch March 20, 2026 14:32
@MikeSchulze MikeSchulze linked an issue Mar 20, 2026 that may be closed by this pull request
@charjr
Copy link
Copy Markdown

charjr commented Mar 20, 2026

@MikeSchulze That looks fantastic, thank you. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GD-1076: The Hooks display are hidden when selected or hovered GD-1061: Improve readability on light themes

2 participants