diff --git src/apps/deskbar/TeamMenuItem.cpp src/apps/deskbar/TeamMenuItem.cpp
index a3f3619..ffbe332 100644
|
|
TTeamMenuItem::DrawContentLabel()
|
445 | 445 | if (Submenu() && fVertical) |
446 | 446 | cachedWidth += 18; |
447 | 447 | |
448 | | const char* label = Label(); |
449 | | char* truncLabel = NULL; |
| 448 | BString label(Label()); |
450 | 449 | float max = 0; |
451 | 450 | |
452 | 451 | if (static_cast<TBarApp*>(be_app)->Settings()->superExpando && fVertical) |
… |
… |
TTeamMenuItem::DrawContentLabel()
|
458 | 457 | BPoint penloc = menu->PenLocation(); |
459 | 458 | BRect frame = Frame(); |
460 | 459 | float offset = penloc.x - frame.left; |
461 | | if (cachedWidth + offset > max) { |
462 | | truncLabel = (char*)malloc(strlen(label) + 4); |
463 | | if (!truncLabel) |
464 | | return; |
465 | | TruncateLabel(max-offset, truncLabel); |
466 | | label = truncLabel; |
467 | | } |
| 460 | if (cachedWidth + offset > max) |
| 461 | menu->TruncateString(&label, B_TRUNCATE_MIDDLE, max - offset); |
468 | 462 | } |
469 | 463 | |
470 | 464 | if (!label) |
471 | | label = Label(); |
| 465 | label = BString(Label()); |
472 | 466 | |
473 | 467 | TBarView* barview = (static_cast<TBarApp*>(be_app))->BarView(); |
474 | 468 | bool canHandle = !barview->Dragging() |
… |
… |
TTeamMenuItem::DrawContentLabel()
|
479 | 473 | else |
480 | 474 | menu->SetLowColor(menu->ViewColor()); |
481 | 475 | |
482 | | menu->DrawString(label); |
483 | | |
484 | | free(truncLabel); |
| 476 | menu->DrawString(label.String()); |
485 | 477 | } |
486 | 478 | |
487 | 479 | |