ColinDuquesnoy / QDarkStyleSheet

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

QMenu section text not visible #332

Open jakeanq opened 1 year ago

jakeanq commented 1 year ago

Describe Your Environment

* OPERATING SYSTEM---------------------------------------------------------------
    - System........................ Linux
    - Release....................... 6.3.3-arch1-1
    - Platform...................... Linux-6.3.3-arch1-1-x86_64-with-glibc2.37
    - Version....................... #1 SMP PREEMPT_DYNAMIC Sun, 21 May 2023 16:15:22 +0000
* PYTHON DISTRIBUTION------------------------------------------------------------
    - Version....................... 3.11.3
    - C Compiler.................... GCC 13.1.1 20230429
    - C API Version................. 1013
    - Implementation................ cpython
    - Implementation Version........ 3.11.3
* QT BINDINGS--------------------------------------------------------------------
    - PySide2 Version............... 5.15.10
    - PySide2 Qt Version............ 5.15.10
* QT ABSTRACTIONS----------------------------------------------------------------
    - qtpy Version.................. 2.3.1
    - 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 [if necessary]

To reproduce, run the following example code and click the button:

import sys
import qdarkstyle
from PySide2 import QtWidgets

class TestWidget(QtWidgets.QMainWindow):
    def __init__(self):
        super().__init__()

        self.menu = QtWidgets.QMenu()
        self.menu.addAction("Turtle")
        self.menu.addSection("Teapot")
        self.menu.addAction("Lemur")

        self.button = QtWidgets.QPushButton("Click Me")
        self.button.setMenu(self.menu)
        self.setCentralWidget(self.button)

if __name__ == "__main__":
    app = QtWidgets.QApplication(sys.argv)
    window = TestWidget()

    app.setStyleSheet(qdarkstyle.load_stylesheet_pyside2())

    window.show()
    app.exec_()

Actual Result

The "Teapot" section text is missing:

image

Expected Results / Proposed Result

image

(the same code but with app.setStyleSheet(...) commented out.