Skip to content
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

Add a pin toggle to prevent involuntary bottom editor switching #98074

Merged
merged 1 commit into from
Nov 11, 2024

Conversation

YeldhamDev
Copy link
Member

@YeldhamDev YeldhamDev commented Oct 10, 2024

image

This PR adds a lock button to the bottom panel, that when toggled, stops switching of one bottom editor to another.
That means if you have the "Output" tab open, then you select an AnimationPlayer node, having the lock enabled will stop it from switching to the "Animation" tab.

Sponsored By: 🐺 Lone Wolf Technology / 🍀 W4 Games.

Production edit:

@Jowan-Spooner
Copy link

Jowan-Spooner commented Oct 10, 2024

I very much like this. However as there is no proposal linked, I'll just ask here: Does this make the pin in the animation editor unnecessary? Or how do these work together?

@YeldhamDev
Copy link
Member Author

@Jowan-Spooner The animation pin just locks the animation context to the selected AnimationPlayer node, which means that if you selected one player, then pin, it will not switch to the context of another player when clicking it.

My PR is completely unrelated to that.

@groud
Copy link
Member

groud commented Oct 11, 2024

I think that's a cool feature. Maybe it should use a "pin" instead of a lock though? Locks usually means you can't edit something.

@YeldhamDev
Copy link
Member Author

@groud I thought about that, but I feared that some people would confuse the functionality with something related to the animation pinning. Which actually just happened above, in fact! 😛

@coppolaemilio
Copy link
Member

To me, lock feels like you won't be able to interact with the panel. Pin gives me a better idea that the panel won't go away

@YeldhamDev
Copy link
Member Author

Alright, it has been changed from a lock to a pin:
image

@fire
Copy link
Member

fire commented Oct 30, 2024

@SaracenOne @lyuma we have discussing for a long time to make pins like this. Letting them know

Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally, it works as expected. This is pretty useful to enable before running the project when you don't want automatic switching to Output to occur (but only momentarily) 🙂

@YeldhamDev YeldhamDev force-pushed the stop_moving_will_ya branch 2 times, most recently from 067d1c0 to 54388f7 Compare October 31, 2024 03:04
@tetrapod00
Copy link
Contributor

tetrapod00 commented Nov 4, 2024

This discussion godotengine/godot-proposals#11087 asks for similar functionality: locking the bottom panel closed, i.e. preventing any bottom panel from opening. They suggest an editor setting, but it seems like this PR could easily be extended to support locking/pinning no open bottom panel.

If this PR is extended to support that use case, a lock icon seems slightly more fitting than a pin icon. But locking/pinning a bottom panel open is a much more common use case, so a pin icon is probably still better overall.

Supporting this other use case can easily be a followup PR, too, but I felt like mentioning it because of the icon issue.

@The2AndOnly
Copy link

This discussion godotengine/godot-proposals#11087 asks for similar functionality: locking the bottom panel closed, i.e. preventing any bottom panel from opening. They suggest an editor setting, but it seems like this PR could easily be extended to support locking/pinning no open bottom panel.

I think this already fixes that. I was suggesting an option to stop the tabs from automatically switching. The bottom panel opening is a result of it switching tabs.

@tetrapod00
Copy link
Contributor

@The2AndOnly
From the other discussion:

I like to work with the bottom tab closed, since it takes a lot of space. But there is an issue that has bothered me ever since I began working with Godot. It's that the tab will automatically open whenever I click on certain nodes in the scene tree.

For example, if I click on an AnimatedSprite2D then it will automatically open / switch to the SpriteFrames tab.
And if I click on an AnimationPLayer then it will automatically open / switch to the Animation tab.

This PR currently does not prevent a closed bottom panel from opening; it only prevents an open bottom panel from switching to another bottom panel. You can try it out yourself by downloading one of the artifacts from the Checks tab of this PR, if you want.

Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine to me.

@akien-mga akien-mga changed the title Add a lock toggle to prevent involuntary bottom editor switching Add a pin toggle to prevent involuntary bottom editor switching Nov 11, 2024
@YeldhamDev
Copy link
Member Author

@akien-mga Changes made.

@Repiteo Repiteo modified the milestones: 4.x, 4.4 Nov 11, 2024
@Repiteo Repiteo merged commit 869e059 into godotengine:master Nov 11, 2024
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Nov 11, 2024

Thanks!

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

Successfully merging this pull request may close these issues.

Add a Pin button to the Inspector dock Allow bottom panels to persist after selecting a different node
10 participants