create a custom Tree-style Control #16
Labels
No Label
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: yagich/tickle-godot-frontend#16
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
the Tree node in Godot is less than ideal for a UI app that has to be interacted with by users, and is clunky to work with from code. i propose a custom implementation, with a reasonable amount of modularity.
features that are a must have:
Object
metadata property)ideas for functionality, and if this is needed at all, are welcome.
the biggest hurdle when making this, i think, will be how to handle hovering and selecting items, since items would have to either:
Button
withtoggle_mode
set to on (which would let the user deselect an item, which i'm not sure is desired behavior) and add label/icons/etc to it as a child, letting Godot provide the necessary hints for focus/hover etc, optionally be in aButtonGroup
to only allow selecting one item at a time, orPanelContainer
and rely onControl
's signals and GUI event functions to do focusing and highlighting.i'm still not sure which approach is best, thoughts?
I'm not sure I understand the problem, but if I do, how about:
Selecting or deselecting a top item selects all children recursively.
I think maybe a mockup of what you envision would help determine a proper technical structure
this is the current mockup i have made with godot:
the first two items are just HBoxContainers, which provides no obvious way to "select" them. the rest of the items are toggleable Buttons that have an HBoxContainer as a child. this lets us easily determine what item is currently being edited.
your mockup seems easier to implement than what i imagined 😄 so i think i will base the design on that. thinking about it more, it makes a lot of sense for the base node of the items to be a button.
another concern i have is how to handle sub-items. i guess if we have a MarginContainer of some size for one "space", that could work? if so the node structure would be something like: