mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Short-circuit text style parsing when unnecessary.
This commit is contained in:
@@ -27,6 +27,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
- The styles `scrollbar-background-active` and `scrollbar-color-hover` are no longer ignored https://github.com/Textualize/textual/pull/1480
|
||||
- The widget `Placeholder` can now have its width set to `auto` https://github.com/Textualize/textual/pull/1508
|
||||
- The style `text-style` option `none` can also be mixed with other options https://github.com/Textualize/textual/issues/1420
|
||||
|
||||
## [0.9.1] - 2022-12-30
|
||||
|
||||
|
||||
@@ -891,6 +891,7 @@ class StyleFlagsProperty:
|
||||
Raises:
|
||||
StyleValueError: If the value is an invalid style flag
|
||||
"""
|
||||
print(repr(style_flags))
|
||||
_rich_traceback_omit = True
|
||||
if style_flags is None:
|
||||
if obj.clear_rule(self.name):
|
||||
@@ -909,7 +910,8 @@ class StyleFlagsProperty:
|
||||
self.name, word, context="inline"
|
||||
),
|
||||
)
|
||||
style = Style.parse(style_flags)
|
||||
# rich doesn't like "none" mixed with other styles, so short-circuit here.
|
||||
style = Style() if "none" in words else Style.parse(style_flags)
|
||||
if obj.set_rule(self.name, style):
|
||||
obj.refresh()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user