Notification: truncate long lines
This happens only if the word-wrapping couldn't fit them (because there is a very long word in the text) Fixes #11494.
This commit is contained in:
@@ -240,7 +240,7 @@ NotificationView::Draw(BRect updateRect)
|
|||||||
|
|
||||||
// Icon size
|
// Icon size
|
||||||
float iconSize = (float)fParent->IconSize();
|
float iconSize = (float)fParent->IconSize();
|
||||||
|
|
||||||
BRect stripeRect = Bounds();
|
BRect stripeRect = Bounds();
|
||||||
stripeRect.right = kIconStripeWidth;
|
stripeRect.right = kIconStripeWidth;
|
||||||
SetHighColor(tint_color(ui_color(B_PANEL_BACKGROUND_COLOR),
|
SetHighColor(tint_color(ui_color(B_PANEL_BACKGROUND_COLOR),
|
||||||
@@ -250,7 +250,7 @@ NotificationView::Draw(BRect updateRect)
|
|||||||
SetHighColor(fStripeColor);
|
SetHighColor(fStripeColor);
|
||||||
stripeRect.right = 2;
|
stripeRect.right = 2;
|
||||||
FillRect(stripeRect);
|
FillRect(stripeRect);
|
||||||
|
|
||||||
SetHighColor(ui_color(B_PANEL_TEXT_COLOR));
|
SetHighColor(ui_color(B_PANEL_TEXT_COLOR));
|
||||||
// Rectangle for icon and overlay icon
|
// Rectangle for icon and overlay icon
|
||||||
BRect iconRect(0, 0, 0, 0);
|
BRect iconRect(0, 0, 0, 0);
|
||||||
@@ -277,6 +277,10 @@ NotificationView::Draw(BRect updateRect)
|
|||||||
LineInfo *l = (*lIt);
|
LineInfo *l = (*lIt);
|
||||||
|
|
||||||
SetFont(&l->font);
|
SetFont(&l->font);
|
||||||
|
// Truncate the string. We have already line-wrapped the text but if
|
||||||
|
// there is a very long 'word' we can only truncate it.
|
||||||
|
TruncateString(&(l->text), B_TRUNCATE_END,
|
||||||
|
Bounds().Width() - l->location.x - 8);
|
||||||
DrawString(l->text.String(), l->text.Length(), l->location);
|
DrawString(l->text.String(), l->text.Length(), l->location);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user