ColinDuquesnoy / QDarkStyleSheet

A dark style sheet for QtWidgets application
Other
2.76k stars 725 forks source link

QDateEdit Popup too small, wrong colors for weekends #322

Open oleschum opened 1 year ago

oleschum commented 1 year ago

Describe Your Environment

* OPERATING SYSTEM---------------------------------------------------------------
    - System........................ Linux
    - Release....................... 5.15.0-53-generic
    - Platform...................... Linux-5.15.0-53-generic-x86_64-with-glibc2.35
    - Version....................... #59-Ubuntu SMP Mon Oct 17 18:53:30 UTC 2022
* PYTHON DISTRIBUTION------------------------------------------------------------
    - Version....................... 3.10.6
    - C Compiler.................... GCC 11.3.0
    - C API Version................. 1013
    - Implementation................ cpython
    - Implementation Version........ 3.10.6
* QT BINDINGS--------------------------------------------------------------------
    - PySide2 Version............... 5.15.2.1
    - PySide2 Qt Version............ 5.15.2
* QT ABSTRACTIONS----------------------------------------------------------------
    - qtpy Version.................. 2.3.0
    - qtpy Binding.................. pyside2
    - qtpy Binding Variable......... os.environ['QT_API']
    - qtpy Import Name.............. qtpy
    - qtpy Status................... OK
* PYTHON PACKAGES----------------------------------------------------------------
    - helpdev....................... 0.7.1
    - QDarkStyle.................... 3.1

Language

Python

Description / Steps to Reproduce

The calendar popup of the widget QDateEdit is too small and has incorrect coloring. Weekends are not consistently colored red. The root cause seems to lie in the QCalendarWidget that is used by QDateEdit's popup.

Actual Result

dateedit_qdarkstyle

Expected Results / Proposed Result

More space for the popup so that no parts are cut off and red colors for the weekend in a consistent manner.

Relevant Code

MWE to reproduce this:

from PySide2 import QtWidgets
import qdarkstyle

class DateEditGui(QtWidgets.QMainWindow):
    def __init__(self):
        super().__init__()
        widget = QtWidgets.QWidget()
        self.vertical_layout = QtWidgets.QVBoxLayout()

        self.date_picker = QtWidgets.QDateEdit()
        self.date_picker.setCalendarPopup(True)

        # self.calendar = QtWidgets.QCalendarWidget()

        self.vertical_layout.addWidget(self.date_picker)
        self.vertical_layout.addWidget(self.calendar)

        widget.setLayout(self.vertical_layout)
        self.setCentralWidget(widget)

app = QtWidgets.QApplication()
app.setStyleSheet(qdarkstyle.load_stylesheet(qt_api='pyside2'))
window = DateEditGui()
window.show()
app.exec_()