Don't hardcode the NotificationView width to 300px.
This commit is contained in:
@@ -516,24 +516,19 @@ NotificationView::MessageID() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BSize
|
void
|
||||||
NotificationView::_CalculateSize()
|
NotificationView::_CalculateSize()
|
||||||
{
|
{
|
||||||
BSize size;
|
float height = fHeight;
|
||||||
|
|
||||||
size.width = 300;
|
|
||||||
size.height = fHeight;
|
|
||||||
|
|
||||||
if (fNotification->Type() == B_PROGRESS_NOTIFICATION) {
|
if (fNotification->Type() == B_PROGRESS_NOTIFICATION) {
|
||||||
font_height fh;
|
font_height fh;
|
||||||
be_plain_font->GetHeight(&fh);
|
be_plain_font->GetHeight(&fh);
|
||||||
float fontHeight = fh.ascent + fh.descent + fh.leading;
|
float fontHeight = fh.ascent + fh.descent + fh.leading;
|
||||||
size.height += 9 + (kSmallPadding * 2) + (kEdgePadding * 1)
|
height += 9 + (kSmallPadding * 2) + (kEdgePadding * 1)
|
||||||
+ fontHeight * 2;
|
+ fontHeight * 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
SetExplicitMinSize(size);
|
SetExplicitMinSize(BSize(0, height));
|
||||||
SetExplicitMaxSize(size);
|
SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, height));
|
||||||
|
|
||||||
return size;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public:
|
|||||||
const char* MessageID() const;
|
const char* MessageID() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BSize _CalculateSize();
|
void _CalculateSize();
|
||||||
|
|
||||||
struct LineInfo {
|
struct LineInfo {
|
||||||
BFont font;
|
BFont font;
|
||||||
|
|||||||
Reference in New Issue
Block a user