ExpandSize flag - ability to make window bigger when construct size is smaller than min main widget size.

This commit is contained in:
and3md 2017-10-07 14:49:44 +02:00
parent 23913e73f3
commit f453a4fe89
1 changed files with 3 additions and 1 deletions

View File

@ -56,6 +56,8 @@ enum WindowFlag : uint {
MeasureSize = 8,
/// window without decorations
Borderless = 16,
/// expand window size if main widget minimal size is greater than size defined in window constructor
ExpandSize = 32,
}
/// Window states
@ -466,7 +468,7 @@ class Window : CustomEventTarget {
void adjustWindowOrContentSize(int minContentWidth, int minContentHeight) {
_minContentWidth = minContentWidth;
_minContentHeight = minContentHeight;
if (_windowOrContentResizeMode == WindowOrContentResizeMode.resizeWindow)
if (_windowOrContentResizeMode == WindowOrContentResizeMode.resizeWindow || flags & WindowFlag.ExpandSize)
resizeWindow(Point(max(_windowRect.right, minContentWidth), max(_windowRect.bottom, minContentHeight)));
updateWindowOrContentSize();
}