You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I really like this theme. To make my layout consistent I need to reduce the height of all QComboBoxes.
Before qdarktheme.setup_theme this can be done by setting maximumHeight or stylesheets, but after qdarktheme.setup_theme these no longer work.
Is there a way to change the height or to not apply the style to QComboBoxes so they can be styled individually?
Below is a simple example. After you click on qdarktheme, reduceHeight is ineffective.
import sys
import qdarktheme
from PyQt6.QtWidgets import QApplication,QWidget,QPushButton,QVBoxLayout,QLabel,QComboBox
class Foo(QWidget):
def __init__(self):
super().__init__()
lay = QVBoxLayout(self)
b = QPushButton('qdarktheme')
b.clicked.connect(self.setupTheme)
lay.addWidget(b)
b = QPushButton('reduceHeight')
b.clicked.connect(self.reduceHeight)
lay.addWidget(b)
qcb = QComboBox()
lay.addWidget(QLabel('Test'))
lay.addWidget(qcb)
self.qcb = QComboBox()
lay.addWidget(QLabel('Test'))
lay.addWidget(self.qcb)
def reduceHeight(self):
self.qcb.setMaximumHeight(10) # only moves combobox when qdarktheme applied
# self.qcb.setStyleSheet('QComboBox {padding: 0px;margin: 0px;}') # no effect when qdarktheme applied
def setupTheme(self):
qdarktheme.setup_theme(theme='light', corner_shape="sharp")
if __name__ == '__main__':
app = QApplication(sys.argv)
app.setStyle('Fusion')
mainWindow = Foo()
mainWindow.show()
sys.exit(app.exec())
The text was updated successfully, but these errors were encountered:
Thank you!
I ended up custimizing the standardPallete and styleSheet instead of using this theme, which gave similar results and did not require any workarounds.
I really like this theme. To make my layout consistent I need to reduce the height of all QComboBoxes.
Before qdarktheme.setup_theme this can be done by setting maximumHeight or stylesheets, but after qdarktheme.setup_theme these no longer work.
Is there a way to change the height or to not apply the style to QComboBoxes so they can be styled individually?
Below is a simple example. After you click on qdarktheme, reduceHeight is ineffective.
The text was updated successfully, but these errors were encountered: