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.3k stars 242 forks source link

Items size #1

Open maicol07 opened 4 years ago

maicol07 commented 4 years ago

It seems that a lot of elements doesn't get resized when changing theme in runtime:

gavinnn101 commented 3 years ago

I'm also getting this with all themes.. Any ideas?

YeisonCardona commented 3 years ago

Sorry, since I have not a windows machine I can not test this issue, maybe someone else can help us with this.

chrisbeardy commented 3 years ago

I get a similar issue but the other way around. I am using qt designer and set my buttons to a size I want, then if I apply the theme, some items such as pushbuttons get made smaller upon applying the theme, meaning text gets truncated. I am using Windows too.

JackPieCZ commented 3 years ago

Since material.css.template is overriding some font-sizes, widget sizes etc. there are two possible solutions:

  1. Find the problematic widget in material.css.template file (can be found in qt_material/material.css.template) and delete or comment-out lines that are interfering with sizes (that works for me, right now I'm using very self-customized material.css.template since not everything worked as I expected/wanted from the start)
  2. Hardcode every problematic's widget size (.setFixedSize) and I necessary font size (.setFont(QFont(,)))
YeisonCardona commented 3 years ago

Hi, @JackPieCZ and @chrisbeardy I just removed the 'font-size' from widgets, hope that this solve this issue.

jgrichard commented 2 years ago

Removing font-size from material.css.template fixes issue: https://github.com/UN-GCPDS/qt-material/issues/57. Thank you!