mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Inline border invalid number of edges help text
This commit is contained in:
@@ -85,7 +85,7 @@ class BasicApp(App):
|
||||
|
||||
def action_increase_margin(self):
|
||||
old_margin = self.focused.styles.margin
|
||||
self.focused.styles.border = [("solid", "green"), ("dashed", "s")]
|
||||
self.focused.styles.border = [("solid", "green"), ("dashed", "red")]
|
||||
|
||||
|
||||
BasicApp.run(css_file="uber.css", log="textual.log", log_verbosity=1)
|
||||
|
||||
@@ -267,7 +267,7 @@ def border_property_help_text(
|
||||
f'widget.styles.{property_name} = ("solid", "red")'
|
||||
),
|
||||
Example(
|
||||
f'widget.styles.{property_name} = ("round", #f0f0f0")'
|
||||
f'widget.styles.{property_name} = ("round", "#f0f0f0")'
|
||||
),
|
||||
Example(
|
||||
f'widget.styles.{property_name} = [("dashed", "#f0f0f0"), ("solid", "blue")] [dim]# Vertical, horizontal'
|
||||
@@ -275,7 +275,7 @@ def border_property_help_text(
|
||||
],
|
||||
),
|
||||
Bullet(
|
||||
f"Valid values for <bordertype> are:\n {friendly_list(VALID_BORDER)}"
|
||||
f"Valid values for <bordertype> are:\n{friendly_list(VALID_BORDER)}"
|
||||
),
|
||||
Bullet(
|
||||
f"Colors can be specified using hex, RGB, or ANSI color names"
|
||||
|
||||
@@ -341,7 +341,10 @@ class BorderProperty:
|
||||
setattr(obj, bottom, _border3)
|
||||
setattr(obj, left, _border4)
|
||||
else:
|
||||
raise StyleValueError("expected 1, 2, or 4 values")
|
||||
raise StyleValueError(
|
||||
"expected 1, 2, or 4 values",
|
||||
help_text=border_property_help_text(self.name, context="inline"),
|
||||
)
|
||||
obj.refresh(layout=self._layout)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user