Fix windows becoming too cramped

This commit is contained in:
Cacodemon345
2022-02-09 10:36:22 +06:00
committed by GitHub
parent 633d3fd9f0
commit d1dcf9a2df

View File

@@ -35,8 +35,10 @@ void StyleOverride::polish(QWidget* widget)
/* Disable title bar context help buttons globally as they are unused. */ /* Disable title bar context help buttons globally as they are unused. */
if (widget->isWindow()) { if (widget->isWindow()) {
if (widget->layout() && widget->minimumSize() == widget->maximumSize()) { if (widget->layout() && widget->minimumSize() == widget->maximumSize()) {
widget->setFixedSize(QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX)); if (widget->minimumSize() < widget->minimumSizeHint()) {
widget->layout()->setSizeConstraint(QLayout::SetFixedSize); widget->setFixedSize(QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX));
widget->layout()->setSizeConstraint(QLayout::SetFixedSize);
}
widget->setWindowFlag(Qt::MSWindowsFixedSizeDialogHint, true); widget->setWindowFlag(Qt::MSWindowsFixedSizeDialogHint, true);
} }
widget->setWindowFlag(Qt::WindowContextHelpButtonHint, false); widget->setWindowFlag(Qt::WindowContextHelpButtonHint, false);