fix(log_panel): rename self.log to self._log_widget to avoid Textual property conflict
All checks were successful
Build and Release .deb / build-deb (push) Successful in 21s
All checks were successful
Build and Release .deb / build-deb (push) Successful in 21s
This commit is contained in:
parent
f4db16327f
commit
eed84f36e8
1 changed files with 7 additions and 7 deletions
|
|
@ -23,21 +23,21 @@ class LogPanel(Vertical):
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.log = None
|
self._log_widget = None
|
||||||
|
|
||||||
def compose(self):
|
def compose(self):
|
||||||
with Horizontal(id="log-toolbar"):
|
with Horizontal(id="log-toolbar"):
|
||||||
yield Button("⬅ Retour", id="log-back")
|
yield Button("⬅ Retour", id="log-back")
|
||||||
self.log = RichLog(id="log-view", highlight=True)
|
self._log_widget = RichLog(id="log-view", highlight=True)
|
||||||
yield self.log
|
yield self._log_widget
|
||||||
|
|
||||||
def write(self, line: str):
|
def write(self, line: str):
|
||||||
if self.log:
|
if self._log_widget:
|
||||||
self.log.write(line)
|
self._log_widget.write(line)
|
||||||
|
|
||||||
def clear(self):
|
def clear(self):
|
||||||
if self.log:
|
if self._log_widget:
|
||||||
self.log.clear()
|
self._log_widget.clear()
|
||||||
|
|
||||||
def on_button_pressed(self, event: Button.Pressed):
|
def on_button_pressed(self, event: Button.Pressed):
|
||||||
if event.button.id == "log-back":
|
if event.button.id == "log-back":
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue