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

Support High Density #42

Open pstavirs opened 2 years ago

pstavirs commented 2 years ago

The default material spacing is not suitable for high-density interfaces.

Material provides Density Guidelines - it would be good to support these.

PS - I'm planning to use the export feature to generate QSS for use with Qt-C++ apps.

YeisonCardona commented 2 years ago

Hi @pstavirs. That's could be an amazing feature. I will try to implement something like this.

pstavirs commented 2 years ago

I'm not a Python/Jinja/CSS expert, but one way to implement could be to define a density variable in the .xml and use it as a multiplication factor in the jinja template.

I'm a Qt/C++ developer and if there's anyway I can help, I would be happy to.

YeisonCardona commented 2 years ago

Hi @pstavirs

I already have an approach that works with the extra argument:

extra = {

    # Density Scale
    'density_scale': '-2',
}

apply_stylesheet(app, 'default', invert_secondary=False, extra=extra)

the value of density_scale is 0 by default.

In this moment only affects some inputs heights and margins, I will try to do a better integration with other parameters.

density

pstavirs commented 2 years ago

@YeisonCardona : Looks promising!

pstavirs commented 2 years ago

I know this is not yet done, so this is just feedback.

With density=-2, the menu item icon and text overlap - image