Ensure toolbar is always loaded at end of MainWindow init (weird random bug)
This commit is contained in:
parent
808b878658
commit
46aed33cf7
2 changed files with 8 additions and 2 deletions
|
|
@ -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."""
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue