diff --git a/src/servers/notification/NotificationView.cpp b/src/servers/notification/NotificationView.cpp index 06c89e70fb..3bfff101bd 100644 --- a/src/servers/notification/NotificationView.cpp +++ b/src/servers/notification/NotificationView.cpp @@ -516,24 +516,19 @@ NotificationView::MessageID() const } -BSize +void NotificationView::_CalculateSize() { - BSize size; - - size.width = 300; - size.height = fHeight; + float height = fHeight; if (fNotification->Type() == B_PROGRESS_NOTIFICATION) { font_height fh; be_plain_font->GetHeight(&fh); float fontHeight = fh.ascent + fh.descent + fh.leading; - size.height += 9 + (kSmallPadding * 2) + (kEdgePadding * 1) + height += 9 + (kSmallPadding * 2) + (kEdgePadding * 1) + fontHeight * 2; } - SetExplicitMinSize(size); - SetExplicitMaxSize(size); - - return size; + SetExplicitMinSize(BSize(0, height)); + SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, height)); } diff --git a/src/servers/notification/NotificationView.h b/src/servers/notification/NotificationView.h index b5ada59e5f..37ed61c7da 100644 --- a/src/servers/notification/NotificationView.h +++ b/src/servers/notification/NotificationView.h @@ -51,7 +51,7 @@ public: const char* MessageID() const; private: - BSize _CalculateSize(); + void _CalculateSize(); struct LineInfo { BFont font;