diff --git a/src/apps/terminal/AppearPrefView.cpp b/src/apps/terminal/AppearPrefView.cpp
index 4f9bcca..48598dc 100644
a
|
b
|
AppearancePrefView::_MakeFontMenu(uint32 command,
|
454 | 454 | /*static*/ BMenu* |
455 | 455 | AppearancePrefView::_MakeSizeMenu(uint32 command, uint8 defaultSize) |
456 | 456 | { |
457 | | BPopUpMenu* menu = new BPopUpMenu("size"); |
458 | | int32 sizes[] = {9, 10, 11, 12, 14, 16, 18, 0}; |
459 | | |
460 | | bool found = false; |
461 | | |
462 | | for (uint32 i = 0; sizes[i]; i++) { |
| 457 | BPopUpMenu* menu = new BPopUpMenu("size"); |
| 458 | int32 sizes[] = {9, 10, 11, 12, 14, 16, 18}; /** Must be monotonically increasing sequence */ |
| 459 | const uint8 SIZES_MAX = sizeof(sizes)/sizeof(sizes[0]); |
| 460 | bool found = false; |
| 461 | BMenuItem* item; |
| 462 | |
| 463 | for (uint32 i = 0; i < SIZES_MAX; i++) { |
| 464 | if (!found && defaultSize < sizes[i]) { |
| 465 | BString string; |
| 466 | string << defaultSize; |
| 467 | |
| 468 | item = new BMenuItem(string.String(), new BMessage(command)); |
| 469 | item->SetMarked(true); |
| 470 | menu->AddItem(item); |
| 471 | found = true; |
| 472 | } |
463 | 473 | BString string; |
464 | 474 | string << sizes[i]; |
465 | 475 | |
466 | | BMenuItem* item = new BMenuItem(string.String(), new BMessage(command)); |
467 | | menu->AddItem(item); |
468 | | |
469 | | if (sizes[i] == defaultSize) { |
| 476 | item = new BMenuItem(string.String(), new BMessage(command)); |
| 477 | if (defaultSize == sizes[i]) { |
470 | 478 | item->SetMarked(true); |
471 | 479 | found = true; |
472 | 480 | } |
| 481 | menu->AddItem(item); |
473 | 482 | } |
474 | 483 | if (!found) { |
475 | | for (uint32 i = 0; sizes[i]; i++) { |
476 | | if (sizes[i] > defaultSize) { |
477 | | BString string; |
478 | | string << defaultSize; |
479 | | BMenuItem* item = new BMenuItem(string.String(), |
480 | | new BMessage(command)); |
481 | | item->SetMarked(true); |
482 | | menu->AddItem(item, i); |
483 | | break; |
484 | | } |
485 | | } |
486 | | } |
| 484 | BString string; |
| 485 | string << defaultSize; |
487 | 486 | |
| 487 | item = new BMenuItem(string.String(), new BMessage(command)); |
| 488 | item->SetMarked(true); |
| 489 | menu->AddItem(item); |
| 490 | } |
488 | 491 | return menu; |
489 | 492 | } |
490 | 493 | |