From ca766a50fe121e81e36cb4bde051b51a2bd2647e Mon Sep 17 00:00:00 2001 From: John Scipione Date: Tue, 19 Apr 2016 13:50:19 -0700 Subject: [PATCH] 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. --- src/kits/interface/Menu.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/kits/interface/Menu.cpp b/src/kits/interface/Menu.cpp index eb8ea7547b..bc6a45b77b 100644 --- a/src/kits/interface/Menu.cpp +++ b/src/kits/interface/Menu.cpp @@ -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