1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

StandaloneFilterWindow: Take native window borders into account when constraining size

This commit is contained in:
attila 2021-12-20 21:46:55 +01:00 committed by Attila Szarvas
parent 6eac100a79
commit e329f524a2

View file

@ -979,8 +979,17 @@ private:
if (auto* editorConstrainer = editor->getConstrainer())
{
const auto borders = owner.getContentComponentBorder();
const auto extraWindowWidth = borders.getLeftAndRight();
const auto extraWindowHeight = extraHeight + borders.getTopAndBottom();
const auto windowBorders = [&]() -> BorderSize<int>
{
if (auto* peer = owner.getPeer())
return peer->getFrameSize();
return {};
}();
const auto extraWindowWidth = borders.getLeftAndRight() + windowBorders.getLeftAndRight();
const auto extraWindowHeight = extraHeight + borders.getTopAndBottom() + windowBorders.getTopAndBottom();
owner.setResizeLimits (jmax (10, editorConstrainer->getMinimumWidth() + extraWindowWidth),
jmax (10, editorConstrainer->getMinimumHeight() + extraWindowHeight),