Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The QComboBox looks too thick in "other applications" #352

Open
hmaarrfk opened this issue May 19, 2024 · 0 comments
Open

The QComboBox looks too thick in "other applications" #352

hmaarrfk opened this issue May 19, 2024 · 0 comments

Comments

@hmaarrfk
Copy link
Contributor

I'm really not sure why this happens, but there seems to be some discrepancies between the demo application and "other applications".

I wonder if the original issues reported in #103 and #111 are still valid in 2024. I removed the line that had the comments relating to them:

https://github.com/ColinDuquesnoy/QDarkStyleSheet/blob/6f3962e63749893f951be73ebfec93e83fffebf2/qdarkstyle/qss/_styles.scss#L1309C1-L1310C23

and things seem OK.

The problem with these lines is that they make the QComboBox look too high compared to other widgets that might be next to it like a button.

import re
from PySide6.QtWidgets import QApplication, QMainWindow, QWidget, QHBoxLayout, QComboBox, QPushButton
from qdarkstyle import load_stylesheet
class MainWindow(QMainWindow):
    def __init__(self):
        super().__init__()

        # Create central widget
        central_widget = QWidget()
        self.setCentralWidget(central_widget)

        # Create layout
        layout = QHBoxLayout()
        central_widget.setLayout(layout)

        # Create combo box with 3 items
        combo_box = QComboBox()
        combo_box.addItems(["Item 1 gyjqtA", "Item 2", "Item 3"])

        # Create push button
        button = QPushButton("hello")

        # Add widgets to layout
        layout.addWidget(combo_box)
        layout.addWidget(button)

app = QApplication([])
stylesheet = load_stylesheet()
# stylesheet = re.sub(r'\s*/\* Fixes #103, #111 \*/\s*\n\s*min-height: 1\.5em;\s*', '', stylesheet)
app.setStyleSheet(stylesheet)
window = MainWindow()
window.show()
app.exec()

With those two lines
image

import re
stylesheet = re.sub(r'\s*/\* Fixes #103, #111 \*/\s*\n\s*min-height: 1\.5em;\s*', '', stylesheet)

Patching them out:
image

Thanks making this theme cool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant