5yutan5 / PyQtDarkTheme

A flat dark theme for PySide and PyQt.
https://pyqtdarktheme.readthedocs.io
MIT License
568 stars 89 forks source link

issue with calendar #207

Open thiva7 opened 1 year ago

thiva7 commented 1 year ago

when adding calendar is not "add color " to selected date simple code with only calendar widget

from PyQt5 import QtCore, QtGui, QtWidgets
import qdarktheme
from qdarktheme.qtpy.QtWidgets import QApplication

class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(800, 600)
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.verticalLayout = QtWidgets.QVBoxLayout(self.centralwidget)
        self.verticalLayout.setObjectName("verticalLayout")
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtWidgets.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 26))
        self.menubar.setObjectName("menubar")
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QtWidgets.QStatusBar(MainWindow)
        self.statusbar.setObjectName("statusbar")
        MainWindow.setStatusBar(self.statusbar)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)

        # add calendar to centralwidget
        self.calendar = QtWidgets.QCalendarWidget(self.centralwidget)
        self.calendar.setObjectName("calendar")
        self.verticalLayout.addWidget(self.calendar)

    def retranslateUi(self, MainWindow):
        _translate = QtCore.QCoreApplication.translate
        MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))

if __name__ == "__main__":
    import sys

    qdarktheme.enable_hi_dpi()
    app = QApplication(sys.argv)
    qdarktheme.setup_theme("auto")
    MainWindow = QtWidgets.QMainWindow()
    ui = Ui_MainWindow()
    ui.setupUi(MainWindow)
    MainWindow.show()
    sys.exit(app.exec_())
5yutan5 commented 1 year ago

Hi @thiva7. Thank you for your report. I could replicate this problem on Windows, but Mac cannot. Recently I only tested on Mac. I will try to fix it.

5yutan5 commented 1 year ago

Hi this is fix on #209.

5yutan5 commented 1 year ago

This change has been released on v2.0.0.