diff --git a/CHANGELOG.md b/CHANGELOG.md index 60f70ba18..a60d76c47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,12 +21,24 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Markdown document sub-widgets now reference the container document - Table of contents of a markdown document now references the document - Added the `control` property to messages - - `OptionList.OptionHighlighted` and `OptionList.OptionSelected` - - `Tree.NodeSelected`, `Tree.NodeHighlighted`, `Tree.NodeExpanded`, and `Tree.NodeCollapsed` - `DirectoryTree.FileSelected` - - `ListView.Highlighted` and `ListView.Selected` - - `Markdown.TableOfContentsUpdated`, `Markdown.TableOfContentsSelected`, and `Markdown.LinkClicked` + - `ListView` + - `Highlighted` + - `Selected` + - `Markdown` + - `TableOfContentsUpdated` + - `TableOfContentsSelected` + - `LinkClicked` + - `OptionList` + - `OptionHighlighted` + - `OptionSelected` - `RadioSet.Changed` + - `TabContent.TabActivated` + - `Tree` + - `NodeSelected` + - `NodeHighlighted` + - `NodeExpanded` + - `NodeCollapsed` ## [0.23.0] - 2023-05-03 diff --git a/src/textual/widgets/_tabbed_content.py b/src/textual/widgets/_tabbed_content.py index e842f56ce..f069e4033 100644 --- a/src/textual/widgets/_tabbed_content.py +++ b/src/textual/widgets/_tabbed_content.py @@ -96,9 +96,20 @@ class TabbedContent(Widget): tab: The Tab widget that was selected (contains the tab label). """ self.tabbed_content = tabbed_content + """The `TabbedContent` widget that contains the tab activated.""" self.tab = tab + """The `Tab` widget that was selected (contains the tab label).""" super().__init__() + @property + def control(self) -> TabbedContent: + """The `TabbedContent` widget that contains the tab activated. + + This is an alias for [`TabActivated.tabbed_content`][textual.widgets.TabbedContent.TabActivated.tabbed_content] + and is used by the [`on`][textual.on] decorator. + """ + return self.tabbed_content + def __rich_repr__(self) -> Result: yield self.tabbed_content yield self.tab