mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
comment
This commit is contained in:
@@ -408,6 +408,7 @@ class Stylesheet:
|
|||||||
|
|
||||||
component_classes = node._get_component_classes()
|
component_classes = node._get_component_classes()
|
||||||
if component_classes:
|
if component_classes:
|
||||||
|
# Create virtual nodes that exist to extract styles
|
||||||
refresh_node = False
|
refresh_node = False
|
||||||
old_component_styles = node._component_styles.copy()
|
old_component_styles = node._component_styles.copy()
|
||||||
node._component_styles.clear()
|
node._component_styles.clear()
|
||||||
@@ -419,6 +420,7 @@ class Stylesheet:
|
|||||||
not refresh_node
|
not refresh_node
|
||||||
and old_component_styles.get(component) != virtual_node.styles
|
and old_component_styles.get(component) != virtual_node.styles
|
||||||
):
|
):
|
||||||
|
# If the styles have changed we want to refresh the node
|
||||||
refresh_node = True
|
refresh_node = True
|
||||||
node._component_styles[component] = virtual_node.styles
|
node._component_styles[component] = virtual_node.styles
|
||||||
if refresh_node:
|
if refresh_node:
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ def test_demo(snap_compare):
|
|||||||
"""Test the demo app (python -m textual)"""
|
"""Test the demo app (python -m textual)"""
|
||||||
assert snap_compare(
|
assert snap_compare(
|
||||||
Path("../../src/textual/demo.py"),
|
Path("../../src/textual/demo.py"),
|
||||||
press=["down", "down", "down", "_"],
|
press=["down", "down", "down"],
|
||||||
terminal_size=(100, 30),
|
terminal_size=(100, 30),
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -238,6 +238,4 @@ def test_disabled_widgets(snap_compare):
|
|||||||
|
|
||||||
|
|
||||||
def test_focus_component_class(snap_compare):
|
def test_focus_component_class(snap_compare):
|
||||||
assert snap_compare(
|
assert snap_compare(SNAPSHOT_APPS_DIR / "focus_component_class.py", press=["tab"])
|
||||||
SNAPSHOT_APPS_DIR / "focus_component_class.py", press=["tab", "_"]
|
|
||||||
)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user