mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Process the label on construction of a TreeNode
Currently there's an asymmetry in how the label is handled for a TreeNode. If a str label is passed to the constructor it stays as a str type. On the other hand, if it's set via set_label, it gets processed into a Rich Text type. This commit removes that asymmetry.
This commit is contained in:
@@ -71,7 +71,7 @@ class TreeNode(Generic[TreeDataType]):
|
|||||||
self._tree = tree
|
self._tree = tree
|
||||||
self._parent = parent
|
self._parent = parent
|
||||||
self._id = id
|
self._id = id
|
||||||
self._label = label
|
self._label = tree.process_label(label)
|
||||||
self.data = data
|
self.data = data
|
||||||
self._expanded = expanded
|
self._expanded = expanded
|
||||||
self._children: list[TreeNode] = []
|
self._children: list[TreeNode] = []
|
||||||
|
|||||||
Reference in New Issue
Block a user