Refresh CSS. Args: animate: Also execute CSS animations.
(self, animate: bool = True)
| 3795 | return self |
| 3796 | |
| 3797 | def refresh_css(self, animate: bool = True) -> None: |
| 3798 | """Refresh CSS. |
| 3799 | |
| 3800 | Args: |
| 3801 | animate: Also execute CSS animations. |
| 3802 | """ |
| 3803 | stylesheet = self.app.stylesheet |
| 3804 | stylesheet.set_variables(self.get_css_variables()) |
| 3805 | stylesheet.reparse() |
| 3806 | stylesheet.update(self.app, animate=animate) |
| 3807 | try: |
| 3808 | if self.screen.is_mounted: |
| 3809 | self.screen._refresh_layout(self.size) |
| 3810 | self.screen._css_update_count = self._css_update_count |
| 3811 | except ScreenError: |
| 3812 | pass |
| 3813 | # The other screens in the stack will need to know about some style |
| 3814 | # changes, as a final pass let's check in on every screen that isn't |
| 3815 | # the current one and update them too. |
| 3816 | for screen in self.screen_stack: |
| 3817 | if screen != self.screen: |
| 3818 | stylesheet.update(screen, animate=animate) |
| 3819 | screen._css_update_count = self._css_update_count |
| 3820 | |
| 3821 | def _display(self, screen: Screen, renderable: RenderableType | None) -> None: |
| 3822 | """Display a renderable within a sync. |
no test coverage detected