Don't hardcode the NotificationView width to 300px.

This commit is contained in:
Alex Wilson
2012-04-01 11:54:23 +12:00
parent 2fab0e4804
commit c2fbfb1d58
2 changed files with 6 additions and 11 deletions
+5 -10
View File
@@ -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));
}
+1 -1
View File
@@ -51,7 +51,7 @@ public:
const char* MessageID() const;
private:
BSize _CalculateSize();
void _CalculateSize();
struct LineInfo {
BFont font;