Printers: fix glitches in PrinterListView and JobListView.

* Fix 12103.
This commit is contained in:
Janus 2015-05-31 21:25:38 +02:00
parent 162ae6204b
commit f9f8bce6d2
2 changed files with 9 additions and 5 deletions

View File

@ -311,8 +311,12 @@ JobItem::DrawItem(BView *owner, BRect, bool complete)
owner->DrawBitmap(fIcon, iconPt);
// left of item
owner->DrawString(fName.String(), fName.Length(), namePt);
owner->DrawString(fStatus.String(), fStatus.Length(), statusPt);
BString name = fName;
owner->TruncateString(&name, B_TRUNCATE_MIDDLE, pagePt.x - namePt.x);
owner->DrawString(name.String(), name.Length(), namePt);
BString status = fStatus;
owner->TruncateString(&status, B_TRUNCATE_MIDDLE, sizePt.x - statusPt.x);
owner->DrawString(status.String(), status.Length(), statusPt);
// right of item
owner->DrawString(fPages.String(), fPages.Length(), pagePt);

View File

@ -446,15 +446,14 @@ PrinterItem::DrawItem(BView *owner, BRect /*bounds*/, bool complete)
// left of item
BString s = fName;
owner->TruncateString(&s, B_TRUNCATE_MIDDLE, pendingPt.x - namePt.x);
owner->SetFont(be_bold_font);
owner->TruncateString(&s, B_TRUNCATE_MIDDLE, pendingPt.x - namePt.x);
owner->DrawString(s.String(), s.Length(), namePt);
owner->SetFont(&font);
s = B_TRANSLATE("Driver: %driver%");
s.ReplaceFirst("%driver%", fDriverName);
owner->TruncateString(&s, B_TRUNCATE_END, bounds.Width() - commentPt.x);
owner->TruncateString(&s, B_TRUNCATE_END, commentPt.x - driverPt.x);
owner->DrawString(s.String(), s.Length(), driverPt);
@ -516,6 +515,7 @@ PrinterItem::UpdatePendingJobs()
fPendingJobs = B_TRANSLATE("1 pending job.");
return;
} else if (pendingJobs > 1) {
fPendingJobs = "";
fPendingJobs << pendingJobs << B_TRANSLATE(" pending jobs.");
return;
}