BMenuItem's trigger is drawn at incorrect position.
|Reported by:||hiron||Owned by:||axeld|
|Has a Patch:||no||Platform:||All|
On Haiku, BMenuItem's searching trigger character in its label is case-sensitive. On BeOS R5, it is case-insensitive. To reproduce:
BMenuItem* item = new BMenuItem("Quit", NULL); item->SetTrigger('q');
This menu item draws no trigger underline on Haiku against that the first character (Q) is underlined on BeOS R5.
And if there are multi-byte characters, it fails to locate a correct position. To reproduce:
// "\xe3\x81\x82" is a Japanese hiragana letter A (U+3042) (single character) BMenuItem* item = new BMenuItem("\xe3\x81\x82haiku", NULL); item->SetTrigger('h');
The trigger underline is drawn under 'i', of course the expected behavior is it draws under 'h'. (Even though BeOS R5 has a same bug...)
It seems that in BMenuItem::DrawContent,
font.GetEscapements(fLabel, fTriggerIndex + 1, escapements);
fTriggerIndex has an index in bytes but BFont::GetEscapements takes a number of characters, not bytes.