Check size limit of all stacked windows when resizing. Fixes #7893 thanks to diver (again).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42537 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -340,15 +340,22 @@ Window::ResizeBy(int32 x, int32 y, BRegion* dirtyRegion, bool resizeStack)
|
|||||||
int32 wantHeight = fFrame.IntegerHeight() + y;
|
int32 wantHeight = fFrame.IntegerHeight() + y;
|
||||||
|
|
||||||
// enforce size limits
|
// enforce size limits
|
||||||
if (wantWidth < fMinWidth)
|
WindowStack* stack = GetWindowStack();
|
||||||
wantWidth = fMinWidth;
|
if (resizeStack && stack) {
|
||||||
if (wantWidth > fMaxWidth)
|
for (int32 i = 0; i < stack->CountWindows(); i++) {
|
||||||
wantWidth = fMaxWidth;
|
Window* window = stack->WindowList().ItemAt(i);
|
||||||
|
|
||||||
if (wantHeight < fMinHeight)
|
if (wantWidth < window->fMinWidth)
|
||||||
wantHeight = fMinHeight;
|
wantWidth = window->fMinWidth;
|
||||||
if (wantHeight > fMaxHeight)
|
if (wantWidth > window->fMaxWidth)
|
||||||
wantHeight = fMaxHeight;
|
wantWidth = window->fMaxWidth;
|
||||||
|
|
||||||
|
if (wantHeight < window->fMinHeight)
|
||||||
|
wantHeight = window->fMinHeight;
|
||||||
|
if (wantHeight > window->fMaxHeight)
|
||||||
|
wantHeight = window->fMaxHeight;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
x = wantWidth - fFrame.IntegerWidth();
|
x = wantWidth - fFrame.IntegerWidth();
|
||||||
y = wantHeight - fFrame.IntegerHeight();
|
y = wantHeight - fFrame.IntegerHeight();
|
||||||
@@ -371,7 +378,6 @@ Window::ResizeBy(int32 x, int32 y, BRegion* dirtyRegion, bool resizeStack)
|
|||||||
if (decorator && resizeStack)
|
if (decorator && resizeStack)
|
||||||
decorator->ResizeBy(x, y, dirtyRegion);
|
decorator->ResizeBy(x, y, dirtyRegion);
|
||||||
|
|
||||||
WindowStack* stack = GetWindowStack();
|
|
||||||
if (resizeStack && stack) {
|
if (resizeStack && stack) {
|
||||||
for (int32 i = 0; i < stack->CountWindows(); i++) {
|
for (int32 i = 0; i < stack->CountWindows(); i++) {
|
||||||
Window* window = stack->WindowList().ItemAt(i);
|
Window* window = stack->WindowList().ItemAt(i);
|
||||||
|
|||||||
Reference in New Issue
Block a user