@@ -238,9 +238,7 @@ class StylesBase:
238238
239239 node : DOMNode | None = None
240240
241- display = StringEnumProperty (
242- VALID_DISPLAY , "block" , layout = True , refresh_parent = True , refresh_children = True
243- )
241+ display = StringEnumProperty (VALID_DISPLAY , "block" , layout = True )
244242 """Set the display of the widget, defining how it's rendered.
245243
246244 Valid values are "block" or "none".
@@ -253,9 +251,7 @@ class StylesBase:
253251 StyleValueError: If an invalid display is specified.
254252 """
255253
256- visibility = StringEnumProperty (
257- VALID_VISIBILITY , "visible" , layout = True , refresh_parent = True
258- )
254+ visibility = StringEnumProperty (VALID_VISIBILITY , "visible" , layout = True )
259255 """Set the visibility of the widget.
260256
261257 Valid values are "visible" or "hidden".
@@ -281,6 +277,7 @@ class StylesBase:
281277 """
282278
283279 auto_color = BooleanProperty (default = False )
280+ """Enable automatic picking of best contrasting color."""
284281 color = ColorProperty (Color (255 , 255 , 255 ))
285282 """Set the foreground (text) color of the widget.
286283 Supports `Color` objects but also strings e.g. "red" or "#ff0000".
@@ -326,7 +323,9 @@ class StylesBase:
326323 """Set the left border of the widget e.g. ("rounded", "green") or "none"."""
327324
328325 border_title_align = StringEnumProperty (VALID_ALIGN_HORIZONTAL , "left" )
326+ """The alignment of the border title text."""
329327 border_subtitle_align = StringEnumProperty (VALID_ALIGN_HORIZONTAL , "right" )
328+ """The alignment of the border subtitle text."""
330329
331330 outline = BorderProperty (layout = False )
332331 """Set the outline of the widget e.g. ("rounded", "green") or "none".
@@ -342,8 +341,10 @@ class StylesBase:
342341 """Set the left outline of the widget e.g. ("rounded", "green") or "none"."""
343342
344343 keyline = KeylineProperty ()
344+ """Keyline parameters."""
345345
346346 box_sizing = StringEnumProperty (VALID_BOX_SIZING , "border-box" , layout = True )
347+ """Box sizing method ("border-box" or "conetnt-box")"""
347348 width = ScalarProperty (percent_unit = Unit .WIDTH )
348349 """Set the width of the widget."""
349350 height = ScalarProperty (percent_unit = Unit .HEIGHT )
@@ -632,14 +633,20 @@ def get_rule(self, rule_name: str, default: object = None) -> object:
632633 raise NotImplementedError ()
633634
634635 def refresh (
635- self , * , layout : bool = False , children : bool = False , parent : bool = False
636+ self ,
637+ * ,
638+ layout : bool = False ,
639+ children : bool = False ,
640+ parent : bool = False ,
641+ repaint : bool = True ,
636642 ) -> None :
637643 """Mark the styles as requiring a refresh.
638644
639645 Args:
640646 layout: Also require a layout.
641647 children: Also refresh children.
642648 parent: Also refresh the parent.
649+ repaint: Repaint the widgets.
643650 """
644651
645652 def reset (self ) -> None :
@@ -850,17 +857,22 @@ def set_rule(self, rule: str, value: object | None) -> bool:
850857 return changed
851858
852859 def refresh (
853- self , * , layout : bool = False , children : bool = False , parent : bool = False
860+ self ,
861+ * ,
862+ layout : bool = False ,
863+ children : bool = False ,
864+ parent : bool = False ,
865+ repaint = True ,
854866 ) -> None :
855867 node = self .node
856868 if node is None or not node ._is_mounted :
857869 return
858870 if parent and node ._parent is not None :
859- node ._parent .refresh ()
871+ node ._parent .refresh (repaint = repaint )
860872 node .refresh (layout = layout )
861873 if children :
862874 for child in node .walk_children (with_self = False , reverse = True ):
863- child .refresh (layout = layout )
875+ child .refresh (layout = layout , repaint = repaint )
864876
865877 def reset (self ) -> None :
866878 """Reset the rules to initial state."""
@@ -1334,9 +1346,16 @@ def __rich_repr__(self) -> rich.repr.Result:
13341346 yield rule_name , getattr (self , rule_name )
13351347
13361348 def refresh (
1337- self , * , layout : bool = False , children : bool = False , parent : bool = False
1349+ self ,
1350+ * ,
1351+ layout : bool = False ,
1352+ children : bool = False ,
1353+ parent : bool = False ,
1354+ repaint : bool = True ,
13381355 ) -> None :
1339- self ._inline_styles .refresh (layout = layout , children = children , parent = parent )
1356+ self ._inline_styles .refresh (
1357+ layout = layout , children = children , parent = parent , repaint = repaint
1358+ )
13401359
13411360 def merge (self , other : StylesBase ) -> None :
13421361 """Merge values from another Styles.
0 commit comments