Fix weekend date colours being incorrect on theme change while app is running

This commit is contained in:
Miguel Jacq 2025-11-28 15:27:49 +11:00
parent 1a56fa80ca
commit f6fa0aa997
Signed by: mig5
GPG key ID: 59B3F0C24135C6A9
2 changed files with 4 additions and 1 deletions

View file

@ -6,6 +6,7 @@
* Make it easier to check on or off the checkbox by adding some buffer (instead of having to precisely click inside it)
* Prevent double-click of checkbox leading to selecting/highlighting it
* Slightly fade the text of a checkbox line if the checkbox is checked.
* Fix weekend date colours being incorrect on theme change while app is running
# 0.5.2

View file

@ -1026,10 +1026,12 @@ class MainWindow(QMainWindow):
self.editor.viewport().update()
def _apply_calendar_text_colors(self):
pal = self.palette()
pal = QApplication.instance().palette()
txt = pal.windowText().color()
fmt = QTextCharFormat()
fmt.setForeground(txt)
# Use normal text color for weekends
self.calendar.setWeekdayTextFormat(Qt.Saturday, fmt)
self.calendar.setWeekdayTextFormat(Qt.Sunday, fmt)