HaikuDepot: Truncate copyright label to 45 characters at most.

Some packages have excessively long copyright labels that were forcing
the HaikuDepot window to become too wide. So in this case, put the full
copyright string in the tooltip, and only the first 45 characters in
the label.
This commit is contained in:
Augustin Cavalier 2018-10-28 14:35:36 -04:00
parent e00a489b80
commit aed889ae61

View File

@ -395,7 +395,12 @@ public:
fTitleView->SetText(package.Title());
BString publisher = package.Publisher().Name();
fPublisherView->SetText(publisher);
if (publisher.CountChars() > 45) {
fPublisherView->SetToolTip(publisher);
fPublisherView->SetText(publisher.TruncateChars(45)
.Append(B_UTF8_ELLIPSIS));
} else
fPublisherView->SetText(publisher);
BString version = B_TRANSLATE("%Version%");
version.ReplaceAll("%Version%", package.Version().ToString());