BMenu: Offset the menu field's menu window left 8px

...so that the text when the menu is closed lines up with the text
when the menu is open.

The checkmark is draw to the left of left edge of the closed menufield.
This commit is contained in:
John Scipione
2016-07-31 19:42:39 -07:00
parent e8d4db8e0b
commit ca766a50fe
+7
View File
@@ -2383,6 +2383,13 @@ BMenu::_CalcFrame(BPoint where, bool* scrollOn)
// When added to a BMenuField, a BPopUpMenu is the child of
// a _BMCMenuBar_ to "fake" the menu hierarchy
bool inMenuField = dynamic_cast<_BMCMenuBar_*>(superMenu) != NULL;
// Offset the menu field menu window left by the width of the checkmark
// so that the text when the menu is closed lines up with the text when
// the menu is open.
if (inMenuField)
frame.OffsetBy(-8.0f, 0.0f);
bool scroll = false;
if (superMenu == NULL || superItem == NULL || inMenuField) {
// just move the window on screen