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

Better tab relabelling #3979

Merged
merged 5 commits into from
Jan 8, 2024
Merged

Better tab relabelling #3979

merged 5 commits into from
Jan 8, 2024

Conversation

davep
Copy link
Contributor

@davep davep commented Jan 8, 2024

Implements a better method of changing the label of a Tab; fixes #3901.

This is a fairly small change, which turns Tab.label into a safe way of setting a new label for a Tab. So the question in the original issue would end up being answered with this:

self.query_one(TabbedContent).get_tab("one").label = "Renamed!"

It also quietly supports going via Tab.update too but doesn't advertise it as the approach to take.

The PR also, of course, addresses the issue of the underline not redrawing correctly.

Screen.Recording.2024-01-08.at.15.52.31.mov

@davep davep added bug Something isn't working enhancement New feature or request Task labels Jan 8, 2024
Copy link
Contributor

@rodrigogiraoserrao rodrigogiraoserrao left a comment

Choose a reason for hiding this comment

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

LGTM 🚀🐍

@davep davep self-assigned this Jan 8, 2024
@davep davep merged commit b4ba573 into Textualize:main Jan 8, 2024
20 checks passed
@davep davep deleted the rename-tabs branch January 8, 2024 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request Task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to rename tabs (TabPane).
2 participants