ColinDuquesnoy / QDarkStyleSheet

A dark style sheet for QtWidgets application
Other
2.81k stars 729 forks source link

Title bar of DockWidget is not high enough and title is not fully displayed #314

Open ai-quantum opened 2 years ago

ai-quantum commented 2 years ago

图片 图片 图片 图片

Describe Your Environment

Language

Python

Relevant Code [if necessary]

[A piece of code to reproduce and/or fix this issue]

import sys
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *

import qdarkstyle
from qdarkstyle.light.palette import LightPalette

class Test(QMainWindow):
    def __init__(self, parent = None):
        super(Test, self).__init__(parent)

        self.setCentralWidget(QTextEdit())

        self.dock = QDockWidget("dock", self)

        self.setWindowTitle("Dock demo")

def main():
    app = QApplication(sys.argv)
    app.setStyleSheet(qdarkstyle.load_stylesheet(qt_api='pyqt5', palette=LightPalette()))
    ex = Test()
    ex.show()
    sys.exit(app.exec_())

if __name__ == '__main__':
    main()
ughstudios commented 2 years ago

Did you ever manage to figure this out?

Anderson-312 commented 4 months ago

I meet the same question. I tried some stylesheet like following, it didn't work! The raw results are as follows. 1717511977422

  1. code 1
    self.dock_demo.setStyleSheet(
    """
    QDockWidget::title {
        padding-top: 10px; /* Adjust this value to increase/decrease height */
        padding-bottom: 10px; /* Adjust this value to increase/decrease height */
    }
    """
    )

    The result is that the padding does change, but it doesn't help the problem. 1717511787749

  2. code 2
    self.Log_dock.setStyleSheet("QDockWidget::title{height: 80px;}")

    The result is no change. 1717511947865

    My Environment is:

Is there a solution to this problem now?