UN-GCPDS / qt-material

Material inspired stylesheet for PySide2, PySide6, PyQt5 and PyQt6
https://qt-material.readthedocs.io/en/latest/
BSD 2-Clause "Simplified" License
2.27k stars 241 forks source link

Using `density_scale` <= -2.0 hides scrollbars #64

Closed nicoddemus closed 1 year ago

nicoddemus commented 2 years ago

Hi,

Thanks again for the great library!

Using a density_scale value <= -2.0 causes the scroll bars of views (tables, lists, etc) to disappear.

Consider this example:

from PyQt5.QtWidgets import QApplication, QTableWidget
from qt_material import apply_stylesheet

app = QApplication([])
apply_stylesheet(app, theme='dark_teal.xml')
table = QTableWidget()
table.setRowCount(100)
table.setColumnCount(100)

table.show()
app.exec()

Produces this widget:

image

However, if we apply a density_scale of -2.0:

from PyQt5.QtWidgets import QApplication, QTableWidget
from qt_material import apply_stylesheet

app = QApplication([])
apply_stylesheet(app, theme='dark_teal.xml', extra={"density_scale": -2.0}))
table = QTableWidget()
table.setRowCount(100)
table.setColumnCount(100)

table.show()
app.exec()

The scrollbars disappear:

image

Strangely, if we use something like -1.99, the scrollbars are OK (if a bit thin):

image

Is this a bug or expected behavior?

I'm using density_scale because I want the spacings, fonts, etc to be a bit smaller to get more screen size. Perhaps is there another way to accomplish this?

YeisonCardona commented 1 year ago

Hi, sorry for the late reply. I got distracted by my Mastery. Now no element will have dimensions smaller than 4 pixels after scale calculations.

nicoddemus commented 1 year ago

Thanks for the fix, appreciate it!