diff --git a/src/servers/notification/AppGroupView.cpp b/src/servers/notification/AppGroupView.cpp index 5029808350..e1f36da458 100644 --- a/src/servers/notification/AppGroupView.cpp +++ b/src/servers/notification/AppGroupView.cpp @@ -203,17 +203,22 @@ AppGroupView::MessageReceived(BMessage* msg) return; infoview_t::iterator vIt = find(fInfo.begin(), fInfo.end(), view); + if (vIt == fInfo.end()) + break; - if (vIt != fInfo.end()) { - fInfo.erase(vIt); - GetLayout()->RemoveView(view); - delete view; + fInfo.erase(vIt); + GetLayout()->RemoveView(view); + delete view; + + fParent->PostMessage(msg); + + if (!this->HasChildren()) { + Hide(); + BMessage removeSelfMessage(kRemoveGroupView); + removeSelfMessage.AddPointer("view", this); + fParent->PostMessage(&removeSelfMessage); } - - _ResizeViews(); - - if (Window() != NULL) - Window()->PostMessage(msg); + break; } default: @@ -263,28 +268,6 @@ AppGroupView::Group() const } -void -AppGroupView::_ResizeViews() -{ - int32 children = fInfo.size(); - - if (!fCollapsed) { - for (int32 i = 0; i < children; i++) { - if (fInfo[i]->IsHidden()) - fInfo[i]->Show(); - } - } else { - for (int32 i = 0; i < children; i++) - if (!fInfo[i]->IsHidden()) - fInfo[i]->Hide(); - } - - if (!IsHidden() && !HasChildren()) - Hide(); - fParent->Layout(true); -} - - bool AppGroupView::HasChildren() { diff --git a/src/servers/notification/AppGroupView.h b/src/servers/notification/AppGroupView.h index deb9d09c87..0c1406d56d 100644 --- a/src/servers/notification/AppGroupView.h +++ b/src/servers/notification/AppGroupView.h @@ -35,8 +35,6 @@ public: const BString& Group() const; private: - void _ResizeViews(); - BString fLabel; NotificationWindow* fParent; infoview_t fInfo;