mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 14:58:33 +08:00
Check the min. window sizes
* on smaller screens makes sure the min.sizes are not exceeded * normally not changing min.sizes
This commit is contained in:
@@ -510,4 +510,15 @@ namespace BlackGui
|
||||
if (!widget) { return; }
|
||||
widget->setStyleSheet(widget->styleSheet());
|
||||
}
|
||||
|
||||
void CGuiUtility::superviseMainWindowMinSizes(qreal wRatio, qreal hRatio)
|
||||
{
|
||||
QWidget *w = CGuiUtility::mainApplicationWidget();
|
||||
if (!w) { return; }
|
||||
const QSize s = CGuiUtility::desktopSize();
|
||||
const int minW = wRatio * s.width();
|
||||
const int minH = hRatio * s.height();
|
||||
w->setMinimumWidth(qMin(minW, w->minimumWidth()));
|
||||
w->setMinimumHeight(qMin(minH, w->minimumHeight()));
|
||||
}
|
||||
} // ns
|
||||
|
||||
Reference in New Issue
Block a user