mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Convert some app.update_styles calls into _update_styles calls
This commit is contained in:
@@ -2134,11 +2134,11 @@ class Widget(DOMNode):
|
||||
def watch_mouse_over(self, value: bool) -> None:
|
||||
"""Update from CSS if mouse over state changes."""
|
||||
if self._has_hover_style:
|
||||
self.app.update_styles(self)
|
||||
self._update_styles()
|
||||
|
||||
def watch_has_focus(self, value: bool) -> None:
|
||||
"""Update from CSS if has focus state changes."""
|
||||
self.app.update_styles(self)
|
||||
self._update_styles()
|
||||
|
||||
def _size_updated(
|
||||
self, size: Size, virtual_size: Size, container_size: Size
|
||||
@@ -2486,11 +2486,11 @@ class Widget(DOMNode):
|
||||
|
||||
def _on_descendant_blur(self, event: events.DescendantBlur) -> None:
|
||||
if self._has_focus_within:
|
||||
self.app.update_styles(self)
|
||||
self._update_styles()
|
||||
|
||||
def _on_descendant_focus(self, event: events.DescendantBlur) -> None:
|
||||
if self._has_focus_within:
|
||||
self.app.update_styles(self)
|
||||
self._update_styles()
|
||||
|
||||
def _on_mouse_scroll_down(self, event: events.MouseScrollDown) -> None:
|
||||
if event.ctrl or event.shift:
|
||||
|
||||
@@ -211,7 +211,7 @@ class Button(Static, can_focus=True):
|
||||
def watch_mouse_over(self, value: bool) -> None:
|
||||
"""Update from CSS if mouse over state changes."""
|
||||
if self._has_hover_style and not self.disabled:
|
||||
self.app.update_styles(self)
|
||||
self._update_styles()
|
||||
|
||||
def validate_variant(self, variant: str) -> str:
|
||||
if variant not in _VALID_BUTTON_VARIANTS:
|
||||
|
||||
Reference in New Issue
Block a user