- 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
|
void
|
||||||
SATWindow::MoveWindowToSAT(int32 workspace)
|
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
|
bool
|
||||||
GroupCookie::Init(SATGroup* group, WindowArea* area)
|
GroupCookie::Init(SATGroup* group, WindowArea* area)
|
||||||
{
|
{
|
||||||
@@ -474,11 +508,6 @@ GroupCookie::Init(SATGroup* group, WindowArea* area)
|
|||||||
rightBorder = linearSpec->AddVariable();
|
rightBorder = linearSpec->AddVariable();
|
||||||
bottomBorder = 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) {
|
if (!leftBorder || !topBorder || !rightBorder || !bottomBorder) {
|
||||||
// clean up
|
// clean up
|
||||||
Uninit();
|
Uninit();
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ public:
|
|||||||
|
|
||||||
void DoGroupLayout(SATWindow* triggerWindow);
|
void DoGroupLayout(SATWindow* triggerWindow);
|
||||||
void MoveWindow(int32 workspace);
|
void MoveWindow(int32 workspace);
|
||||||
|
void UpdateWindowSize();
|
||||||
|
|
||||||
SATGroup* GetGroup() { return fSATGroup.Get(); }
|
SATGroup* GetGroup() { return fSATGroup.Get(); }
|
||||||
|
|
||||||
@@ -84,6 +85,9 @@ public:
|
|||||||
|
|
||||||
bool PropagateToGroup(SATGroup* group, WindowArea* area);
|
bool PropagateToGroup(SATGroup* group, WindowArea* area);
|
||||||
|
|
||||||
|
void UpdateGroupWindowsSize();
|
||||||
|
void UpdateWindowSize();
|
||||||
|
|
||||||
//! Move the window to the tab's position.
|
//! Move the window to the tab's position.
|
||||||
void MoveWindowToSAT(int32 workspace);
|
void MoveWindowToSAT(int32 workspace);
|
||||||
|
|
||||||
|
|||||||
@@ -165,16 +165,27 @@ StackAndTile::WindowMoved(Window* window)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (SATKeyPressed())
|
if (SATKeyPressed())
|
||||||
satWindow->FindSnappingCandidates();
|
satWindow->FindSnappingCandidates();
|
||||||
else
|
else
|
||||||
satWindow->DoGroupLayout();
|
satWindow->DoGroupLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
StackAndTile::WindowResized(Window* window)
|
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)
|
if (!satWindow)
|
||||||
return;
|
return;
|
||||||
_ActivateWindow(satWindow);
|
_ActivateWindow(satWindow);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user