From d47ada16bc9119e74427bfd813a8199c2a410041 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Wed, 26 Nov 2014 09:29:48 +0100 Subject: [PATCH] BOptionPopUp: don't offset when there is no label. We add a 8 pixel space between the label and the menu, but we shouldn't do that when the label is empty. This matches BMenuField behavior. Fixes part of #10734. --- src/kits/interface/OptionPopUp.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/kits/interface/OptionPopUp.cpp b/src/kits/interface/OptionPopUp.cpp index 0dd58740e5..8949aa4bc3 100644 --- a/src/kits/interface/OptionPopUp.cpp +++ b/src/kits/interface/OptionPopUp.cpp @@ -193,7 +193,9 @@ BOptionPopUp::AllAttached() BMenu* menu = fMenuField->Menu(); if (menu != NULL) { float labelWidth = fMenuField->StringWidth(fMenuField->Label()); - fMenuField->SetDivider(labelWidth + kLabelSpace); + if (labelWidth > 0.f) + labelWidth += kLabelSapce; + fMenuField->SetDivider(labelWidth); menu->SetTargetForItems(this); } }