diff --git a/pyflow/blocks/codeblock.py b/pyflow/blocks/codeblock.py index b6dcc5b2..f17c400a 100644 --- a/pyflow/blocks/codeblock.py +++ b/pyflow/blocks/codeblock.py @@ -67,6 +67,8 @@ def __init__(self, source: str = "", **kwargs): QPen(QColor("#00ff00")), # Transmitting ] + self.output_panel_background_color = "#1E1E1E" + # Add output pannel self.output_panel = self.init_output_panel() self.run_button = self.init_run_button() @@ -89,6 +91,10 @@ def init_output_panel(self): output_panel = QTextEdit() output_panel.setReadOnly(True) output_panel.setFont(self.source_editor.font()) + style_sheet = ( + f'QTextEdit {{ background-color: "{self.output_panel_background_color}"; }}' + ) + output_panel.setStyleSheet(style_sheet) return output_panel def init_run_button(self): diff --git a/pyflow/blocks/markdownblock.py b/pyflow/blocks/markdownblock.py index bb173f47..182e5a8f 100644 --- a/pyflow/blocks/markdownblock.py +++ b/pyflow/blocks/markdownblock.py @@ -47,8 +47,9 @@ def __init__(self, **kwargs): self.splitter.addWidget(self.editor) self.rendered_markdown = QWebEngineView() + self.output_panel_background_color = "#1E1E1E" self.rendered_markdown.page().setBackgroundColor( - QColor.fromRgba64(0, 0, 0, alpha=0) + QColor(self.output_panel_background_color) ) self.splitter.addWidget(self.rendered_markdown) @@ -58,14 +59,14 @@ def valueChanged(self): """Update markdown rendering when the content of the markdown editor changes.""" t = self.editor.text() - dark_theme = """ + dark_theme =f''' - """ + ''' self.rendered_markdown.setHtml(f"{dark_theme}{markdown(t)}")