diff --git a/src/apps/activitymonitor/ActivityView.cpp b/src/apps/activitymonitor/ActivityView.cpp index 6417aeb358..a4e1ee2b0e 100644 --- a/src/apps/activitymonitor/ActivityView.cpp +++ b/src/apps/activitymonitor/ActivityView.cpp @@ -1448,8 +1448,7 @@ ActivityView::Draw(BRect updateRect) BString label = source->Label(); float possibleLabelWidth = frame.right - colorBox.right - 12 - width; - // TODO: TruncateString() is broken... remove + 5 when fixed! - if (ceilf(StringWidth(label.String()) + 5) > possibleLabelWidth) + if (ceilf(StringWidth(label.String())) > possibleLabelWidth) label = source->ShortLabel(); TruncateString(&label, B_TRUNCATE_MIDDLE, possibleLabelWidth); diff --git a/src/apps/activitymonitor/DataSource.cpp b/src/apps/activitymonitor/DataSource.cpp index 3adadebcf5..9c5116fdf4 100644 --- a/src/apps/activitymonitor/DataSource.cpp +++ b/src/apps/activitymonitor/DataSource.cpp @@ -937,12 +937,15 @@ void CPUUsageDataSource::_SetCPU(int32 cpu) { fCPU = cpu; - fLabel = B_TRANSLATE("CPU"); - if (SystemInfo().CPUCount() > 1) - fLabel << " " << cpu + 1; - fShortLabel = fLabel; - fLabel << " " << B_TRANSLATE("usage"); + if (SystemInfo().CPUCount() > 1) { + fLabel.SetToFormat(B_TRANSLATE("CPU %d usage"), cpu + 1); + fShortLabel.SetToFormat(B_TRANSLATE("CPU %d"), cpu + 1); + + } else { + fLabel = B_TRANSLATE("CPU usage"); + fShortLabel = B_TRANSLATE("CPU"); + } const rgb_color kColors[] = { // TODO: find some better defaults...