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

Adding custom label should automatically switch label mode to "Custom" #1574

Open
matterhorn103 opened this issue Jan 8, 2024 · 3 comments

Comments

@matterhorn103
Copy link
Contributor

When adding a custom text label using the Atom Label Tool, the typed text disappears after text entry is finished and only the element letter is shown. Clicking the atom again makes it reappear, but after pressing enter it always disappears.

The way to make the custom text visible is of course to firstly manually enable the "Label" display type, then go to the View Configuration pane and change the "Atom Labels" option (which should maybe be better called "Label Type") to "Custom".

This is not however immediately obvious and so the apparent behaviour of adding custom labels having no effect is confusing.

I suggest simply that the Label display type is automatically enabled and switched to "Custom", if not already, when a custom label is added.

Alternatively this could be done whenever the Atom Label Tool is selected, but I suspect there are use cases where this might be undesirable.

@ghutchis
Copy link
Member

ghutchis commented Mar 3, 2024

At the moment, this is tricky, since the tool can't force a change to the rendering code.

What I can imagine is that the renderer checks for "Custom" and switch it on if labels are found. I need to think a bit about the best way to do this, likely with a new "molecule changed" flag for labels.

@matterhorn103
Copy link
Contributor Author

I don't understand the code structure all that well, but does the tool need to change the rendering code? Can't it just emit a Signal that triggers the same Slot as is triggered when a different option is chosen from the View Configuration: Atom Labels dropdown?

@ghutchis
Copy link
Member

ghutchis commented Mar 4, 2024

No, because to trigger a slot, it needs to connect to the specific object. The tool has no good way to access that object.

But as I said, there's a functionally equivalent mechanism.

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

No branches or pull requests

2 participants