From 329d422c80edc8e3cf4af15dcdf0b1d2b30a3296 Mon Sep 17 00:00:00 2001 From: Idan Pazi Date: Sun, 12 Jan 2025 10:48:19 +0200 Subject: [PATCH] splash clean bug fix --- pypad/__init__.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pypad/__init__.py b/pypad/__init__.py index 9fd686c..7e1e23f 100644 --- a/pypad/__init__.py +++ b/pypad/__init__.py @@ -418,8 +418,6 @@ def _execute(self, cell_idx, code=None): code = self.get_cell_code(cell_idx) with self.join_edit_block(): self.clear_cell(cell_idx) - if cell_idx == 0 and code == '' and self.table.rows() == 1: - return # keep splash clean self.executing_animation.start() self.latex[cell_idx] = '' @@ -526,7 +524,11 @@ def _handle_execute_reply(self, msg): self.executing_animation.stop() with self.join_edit_block(): if status == 'ok': - self.set_cell_color(self.execute_cell_idx, theme['done_color']) + # keep splash clean: + if self.execute_cell_idx == 0 and self.table.rows() == 1 and self.get_cell_code(self.execute_cell_idx) == '': + self.set_cell_color(self.execute_cell_idx, theme['out_background']) + else: + self.set_cell_color(self.execute_cell_idx, theme['done_color']) else: self.set_cell_color(self.execute_cell_idx, theme['error_color']) if self.execute_cell_idx+1 < self.table.rows():