From 002fd626d6f0be3261121d320ef8a411af389797 Mon Sep 17 00:00:00 2001 From: Alex Wilson Date: Sun, 15 Jan 2012 12:25:57 +0000 Subject: [PATCH] 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. --- src/servers/notification/AppGroupView.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/servers/notification/AppGroupView.cpp b/src/servers/notification/AppGroupView.cpp index 444e4061d0..bb67f2edb7 100644 --- a/src/servers/notification/AppGroupView.cpp +++ b/src/servers/notification/AppGroupView.cpp @@ -169,9 +169,7 @@ AppGroupView::MouseDown(BPoint point) BMessage message(kRemoveGroupView); message.AddPointer("view", this); fParent->PostMessage(&message); - } - - if (fCollapseRect.Contains(point)) { + } else if (fCollapseRect.Contains(point)) { fCollapsed = !fCollapsed; int32 children = fInfo.size(); if (fCollapsed) { @@ -179,16 +177,18 @@ AppGroupView::MouseDown(BPoint point) if (!fInfo[i]->IsHidden()) fInfo[i]->Hide(); } + GetLayout()->SetExplicitMaxSize(GetLayout()->MinSize()); } else { for (int32 i = 0; i < children; i++) { if (fInfo[i]->IsHidden()) fInfo[i]->Show(); } + GetLayout()->SetExplicitMaxSize(BSize(B_SIZE_UNSET, B_SIZE_UNSET)); } + InvalidateLayout(); Invalidate(); // Need to redraw the collapse indicator and title } - }