Skip to content

Commit 426fa61

Browse files
committed
renamed update_ to watch_
1 parent f955af2 commit 426fa61

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/textual/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ async def on_load(self, event: events.Load) -> None:
384384

385385
show_bar: Reactive[bool] = Reactive(False)
386386

387-
def update_show_bar(self, show_bar: bool) -> None:
387+
def watch_show_bar(self, show_bar: bool) -> None:
388388
self.animator.animate(self.bar, "layout_offset_x", -40 if show_bar else 0)
389389

390390
async def action_toggle_sidebar(self) -> None:

src/textual/page.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def contents_size(self) -> Dimensions:
9191
def validate_y(self, value: int) -> int:
9292
return max(0, value)
9393

94-
def update_y(self, new: int) -> None:
94+
def watch_y(self, new: int) -> None:
9595
x, y = self._page.offset
9696
self._page.offset = Point(x, new)
9797

src/textual/reactive.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ def __set__(self, obj: Reactable, value: ReactiveType) -> None:
5454

5555
if current_value != value:
5656

57-
update_function = getattr(obj, f"update_{self.name}", None)
58-
if callable(update_function):
59-
update_function(value)
57+
watch_function = getattr(obj, f"watch_{self.name}", None)
58+
if callable(watch_function):
59+
watch_function(value)
6060
setattr(obj, self.internal_name, value)
6161

6262
if self.layout:

src/textual/widgets/scroll_view.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def validate_y(self, value: float) -> float:
5151
def validate_target_y(self, value: float) -> float:
5252
return clamp(value, 0, self._page.contents_size.height - self.size.height)
5353

54-
def update_y(self, new_value: float) -> None:
54+
def watch_y(self, new_value: float) -> None:
5555
self._page.y = round(new_value)
5656
self._vertical_scrollbar.position = round(new_value)
5757

0 commit comments

Comments
 (0)