Repository: Textualize/textual
File: src/textual/widget.py (Python)

Code before:
            renderable.justify = text_justify

        renderable = _Styled(
            cast(ConsoleRenderable, renderable),
            self.rich_style,
            self.link_style if self.auto_links else None,
        )

        return renderable

    def watch_mouse_over(self, value: bool) -> None:
        """Update from CSS if mouse over state changes."""
        if self._has_hover_style:
            self._update_styles()

    def watch_has_focus(self, value: bool) -> None:
        """Update from CSS if has focus state changes."""
        self._update_styles()

    def watch_disabled(self, disabled: bool) -> None:
        """Update the styles of the widget and its children when disabled is toggled."""
        from .app import ScreenStackError

        if disabled and self.mouse_over:
            self._message_queue.put_nowait(events.Leave())
        try:
            screen = self.screen
            if (
                disabled
                and screen.focused is not None
                and self in screen.focused.ancestors_with_self
            ):
                screen.focused.blur()
        except (ScreenStackError, NoActiveAppError, NoScreen):
            pass

        self._update_styles()

    def _size_updated(
        self, size: Size, virtual_size: Size, container_size: Size, layout: bool = True
    ) -> bool:
        """Called when the widget's size is updated.

        Args:
            size: Screen size.
            virtual_size: Virtual (scrollable) size.
            container_size: Container size (size of parent).
            layout: Perform layout if required.

        Returns:
            True if anything changed, or False if nothing changed.

Review comment (suggestion):
This block all makes sense to me other than posting the `Leave` event, because the mouse has not left the widget.

Code after:
            renderable.justify = text_justify

        renderable = _Styled(
            cast(ConsoleRenderable, renderable),
            self.rich_style,
            self.link_style if self.auto_links else None,
        )

        return renderable

    def watch_mouse_over(self, value: bool) -> None:
        """Update from CSS if mouse over state changes."""
        if self._has_hover_style:
            self._update_styles()

    def watch_has_focus(self, value: bool) -> None:
        """Update from CSS if has focus state changes."""
        self._update_styles()

    def watch_disabled(self, disabled: bool) -> None:
        """Update the styles of the widget and its children when disabled is toggled."""
        from .app import ScreenStackError

        if disabled and self.mouse_over:
            # Ensure widget gets a Leave if it is disabled while hovered
            self._message_queue.put_nowait(events.Leave())
        try:
            screen = self.screen
            if (
                disabled
                and screen.focused is not None
                and self in screen.focused.ancestors_with_self
            ):
                screen.focused.blur()
        except (ScreenStackError, NoActiveAppError, NoScreen):
            pass

        self._update_styles()

    def _size_updated(
        self, size: Size, virtual_size: Size, container_size: Size, layout: bool = True
    ) -> bool:
        """Called when the widget's size is updated.

        Args:
            size: Screen size.
            virtual_size: Virtual (scrollable) size.
            container_size: Container size (size of parent).
            layout: Perform layout if required.

        Returns: