Ensure toolbar is always loaded at end of MainWindow init (weird random bug)
Some checks failed
CI / test (push) Successful in 5m43s
Lint / test (push) Failing after 29s
Trivy / test (push) Successful in 24s

This commit is contained in:
Miguel Jacq 2025-11-26 13:37:13 +11:00
parent 808b878658
commit 46aed33cf7
Signed by: mig5
GPG key ID: 59B3F0C24135C6A9
2 changed files with 8 additions and 2 deletions

View file

@ -356,6 +356,9 @@ class MainWindow(QMainWindow):
self._day_change_timer.timeout.connect(self._on_day_changed) self._day_change_timer.timeout.connect(self._on_day_changed)
self._schedule_next_day_change() self._schedule_next_day_change()
# Ensure toolbar is definitely visible
self.toolBar.setVisible(True)
@property @property
def editor(self) -> MarkdownEditor | None: def editor(self) -> MarkdownEditor | None:
"""Get the currently active editor.""" """Get the currently active editor."""

View file

@ -117,10 +117,13 @@ class MarkdownHighlighter(QSyntaxHighlighter):
# Markdown syntax (the markers themselves) - make invisible # Markdown syntax (the markers themselves) - make invisible
self.syntax_format = QTextCharFormat() self.syntax_format = QTextCharFormat()
# Use the editor background color so they blend in
bg = pal.color(QPalette.Base)
hidden = QColor(bg)
hidden.setAlpha(0)
self.syntax_format.setForeground(hidden)
# Make the markers invisible by setting font size to 0.1 points # Make the markers invisible by setting font size to 0.1 points
self.syntax_format.setFontPointSize(0.1) self.syntax_format.setFontPointSize(0.1)
# Also make them very faint in case they still show
self.syntax_format.setForeground(QColor(250, 250, 250))
def _overlay_range( def _overlay_range(
self, start: int, length: int, overlay_fmt: QTextCharFormat self, start: int, length: int, overlay_fmt: QTextCharFormat