- Update the size constraints when a window has been resized.
- Remove superflouse and wrong SetRange. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38313 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -89,6 +89,29 @@ SATWindow::PropagateToGroup(SATGroup* group, WindowArea* area)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
SATWindow::UpdateGroupWindowsSize()
|
||||
{
|
||||
SATGroup* group = GetGroup();
|
||||
if (!group)
|
||||
return;
|
||||
|
||||
for (int i = 0; i < group->CountItems(); i++) {
|
||||
SATWindow* window = group->WindowAt(i);
|
||||
if (window == this)
|
||||
continue;
|
||||
window->UpdateWindowSize();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
SATWindow::UpdateWindowSize()
|
||||
{
|
||||
fGroupCookie->UpdateWindowSize();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
SATWindow::MoveWindowToSAT(int32 workspace)
|
||||
{
|
||||
@@ -458,6 +481,17 @@ GroupCookie::MoveWindow(int32 workspace)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
GroupCookie::UpdateWindowSize()
|
||||
{
|
||||
BRect frame = fSATWindow->CompleteWindowFrame();
|
||||
|
||||
// adjust window size soft constraints
|
||||
widthConstraint->SetRightSide(frame.Width());
|
||||
heightConstraint->SetRightSide(frame.Height());
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
GroupCookie::Init(SATGroup* group, WindowArea* area)
|
||||
{
|
||||
@@ -474,11 +508,6 @@ GroupCookie::Init(SATGroup* group, WindowArea* area)
|
||||
rightBorder = linearSpec->AddVariable();
|
||||
bottomBorder = linearSpec->AddVariable();
|
||||
|
||||
leftBorder->SetRange(-DBL_MAX, DBL_MAX);
|
||||
topBorder->SetRange(-DBL_MAX, DBL_MAX);
|
||||
rightBorder->SetRange(-DBL_MAX, DBL_MAX);
|
||||
bottomBorder->SetRange(-DBL_MAX, DBL_MAX);
|
||||
|
||||
if (!leftBorder || !topBorder || !rightBorder || !bottomBorder) {
|
||||
// clean up
|
||||
Uninit();
|
||||
|
||||
@@ -32,6 +32,7 @@ public:
|
||||
|
||||
void DoGroupLayout(SATWindow* triggerWindow);
|
||||
void MoveWindow(int32 workspace);
|
||||
void UpdateWindowSize();
|
||||
|
||||
SATGroup* GetGroup() { return fSATGroup.Get(); }
|
||||
|
||||
@@ -84,6 +85,9 @@ public:
|
||||
|
||||
bool PropagateToGroup(SATGroup* group, WindowArea* area);
|
||||
|
||||
void UpdateGroupWindowsSize();
|
||||
void UpdateWindowSize();
|
||||
|
||||
//! Move the window to the tab's position.
|
||||
void MoveWindowToSAT(int32 workspace);
|
||||
|
||||
|
||||
@@ -165,16 +165,27 @@ StackAndTile::WindowMoved(Window* window)
|
||||
return;
|
||||
|
||||
if (SATKeyPressed())
|
||||
satWindow->FindSnappingCandidates();
|
||||
else
|
||||
satWindow->DoGroupLayout();
|
||||
satWindow->FindSnappingCandidates();
|
||||
else
|
||||
satWindow->DoGroupLayout();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
StackAndTile::WindowResized(Window* window)
|
||||
{
|
||||
WindowMoved(window);
|
||||
SATWindow* satWindow = GetSATWindow(window);
|
||||
if (!satWindow)
|
||||
return;
|
||||
|
||||
if (SATKeyPressed())
|
||||
satWindow->FindSnappingCandidates();
|
||||
else {
|
||||
satWindow->DoGroupLayout();
|
||||
// after solve the layout update the size constraints of all windows in
|
||||
// the group
|
||||
satWindow->UpdateGroupWindowsSize();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -185,7 +196,6 @@ StackAndTile::WindowActitvated(Window* window)
|
||||
if (!satWindow)
|
||||
return;
|
||||
_ActivateWindow(satWindow);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user