-
-
Notifications
You must be signed in to change notification settings - Fork 22.8k
Allow tab_rmb_clicked
to always work
#107440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Connecting to the If anything we could improve the Also this looks like it doesn't set the context dock properly, it should work even if the dock right clicked it isn't selected. |
I'll pivot this PR to focus on that signal then, thanks for the advice |
4163845
to
d3c8ab1
Compare
@kitbdev I was able to clean up the click checking, and allowed the |
tab_rmb_clicked
to always work
9d18202
to
c2172d3
Compare
tab_rmb_clicked
to always worktab_rmb_clicked
to always work
c2172d3
to
9e1f398
Compare
9e1f398
to
242193e
Compare
242193e
to
94f0ed0
Compare
Currently, the
tab_rmb_clicked
signal only works whenselect_with_rmb
is enabled. This is not always wanted however, say if you wanted to use the right-click to show a popup. This PR enables thetab_rmb_clicked
signal to always be emitted if you right click a tab, even ifselect_with_rmb
is disabled.Old Comment
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.