Fix NotificationWindow's collapsing bug. (#8288)
When a BTwoDimensionalLayout has no visible elements, it has a max size of B_SIZE_UNLIMITED in both dimensions. In this case, we want it to shrink down to just the insets.
This commit is contained in:
@@ -169,9 +169,7 @@ AppGroupView::MouseDown(BPoint point)
|
|||||||
BMessage message(kRemoveGroupView);
|
BMessage message(kRemoveGroupView);
|
||||||
message.AddPointer("view", this);
|
message.AddPointer("view", this);
|
||||||
fParent->PostMessage(&message);
|
fParent->PostMessage(&message);
|
||||||
}
|
} else if (fCollapseRect.Contains(point)) {
|
||||||
|
|
||||||
if (fCollapseRect.Contains(point)) {
|
|
||||||
fCollapsed = !fCollapsed;
|
fCollapsed = !fCollapsed;
|
||||||
int32 children = fInfo.size();
|
int32 children = fInfo.size();
|
||||||
if (fCollapsed) {
|
if (fCollapsed) {
|
||||||
@@ -179,16 +177,18 @@ AppGroupView::MouseDown(BPoint point)
|
|||||||
if (!fInfo[i]->IsHidden())
|
if (!fInfo[i]->IsHidden())
|
||||||
fInfo[i]->Hide();
|
fInfo[i]->Hide();
|
||||||
}
|
}
|
||||||
|
GetLayout()->SetExplicitMaxSize(GetLayout()->MinSize());
|
||||||
} else {
|
} else {
|
||||||
for (int32 i = 0; i < children; i++) {
|
for (int32 i = 0; i < children; i++) {
|
||||||
if (fInfo[i]->IsHidden())
|
if (fInfo[i]->IsHidden())
|
||||||
fInfo[i]->Show();
|
fInfo[i]->Show();
|
||||||
}
|
}
|
||||||
|
GetLayout()->SetExplicitMaxSize(BSize(B_SIZE_UNSET, B_SIZE_UNSET));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
InvalidateLayout();
|
||||||
Invalidate(); // Need to redraw the collapse indicator and title
|
Invalidate(); // Need to redraw the collapse indicator and title
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user