mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Default with_self to False in walk_children
This commit is contained in:
@@ -1491,7 +1491,7 @@ class App(Generic[ReturnType], DOMNode):
|
||||
nodes: set[DOMNode] = {
|
||||
child
|
||||
for node in self._require_stylesheet_update
|
||||
for child in node.walk_children()
|
||||
for child in node.walk_children(with_self=True)
|
||||
}
|
||||
self._require_stylesheet_update.clear()
|
||||
self.stylesheet.update_nodes(nodes, animate=True)
|
||||
|
||||
@@ -488,7 +488,7 @@ class Stylesheet:
|
||||
animate (bool, optional): Enable CSS animation. Defaults to False.
|
||||
"""
|
||||
|
||||
self.update_nodes(root.walk_children(), animate=animate)
|
||||
self.update_nodes(root.walk_children(with_self=True), animate=animate)
|
||||
|
||||
def update_nodes(self, nodes: Iterable[DOMNode], animate: bool = False) -> None:
|
||||
"""Update styles for nodes.
|
||||
|
||||
@@ -615,7 +615,7 @@ class DOMNode(MessagePump):
|
||||
"""Reset styles back to their initial state"""
|
||||
from .widget import Widget
|
||||
|
||||
for node in self.walk_children():
|
||||
for node in self.walk_children(with_self=True):
|
||||
node._css_styles.reset()
|
||||
if isinstance(node, Widget):
|
||||
node._set_dirty()
|
||||
@@ -648,7 +648,7 @@ class DOMNode(MessagePump):
|
||||
self,
|
||||
filter_type: type[WalkType],
|
||||
*,
|
||||
with_self: bool = True,
|
||||
with_self: bool = False,
|
||||
method: WalkMethod = "depth",
|
||||
reverse: bool = False,
|
||||
) -> list[WalkType]:
|
||||
@@ -658,7 +658,7 @@ class DOMNode(MessagePump):
|
||||
def walk_children(
|
||||
self,
|
||||
*,
|
||||
with_self: bool = True,
|
||||
with_self: bool = False,
|
||||
method: WalkMethod = "depth",
|
||||
reverse: bool = False,
|
||||
) -> list[DOMNode]:
|
||||
@@ -668,7 +668,7 @@ class DOMNode(MessagePump):
|
||||
self,
|
||||
filter_type: type[WalkType] | None = None,
|
||||
*,
|
||||
with_self: bool = True,
|
||||
with_self: bool = False,
|
||||
method: WalkMethod = "depth",
|
||||
reverse: bool = False,
|
||||
) -> list[DOMNode] | list[WalkType]:
|
||||
|
||||
Reference in New Issue
Block a user