godot icon indicating copy to clipboard operation
godot copied to clipboard

Allow TabContainer popup to work when clicking tabs

Open lodetrick opened this issue 5 months ago • 0 comments
trafficstars

Currently, when users add a popup to a TabContainer, it only adds a small icon on the right that they can click to show the popup. Thus, a common use is to allow right clicks to tabs that also brings up the popup. However, the current method to do this is hacky and requires adding another function. The current method is to connect the tabbar's gui_input signal to a new method, in a line like: https://github.com/godotengine/godot/blob/d9cd011e2fa9fa9a3011371843729f33032cee35/editor/editor_dock_manager.cpp#L997

This PR adds an optional boolean to the popup method that can enable this behavior natively, reducing the amount of extra code and hacky workarounds. It's disabled by default to preserve compatibility.

I don't know how much the maintainers would want to expose this but I do think that it is a good usability enhancement. Worst case if this doesn't get exposed a boolean could be made with new methods so the existing methods don't get changed.

lodetrick avatar Jun 12 '25 06:06 lodetrick