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.
This commit is contained in:
parent
d67977a5ae
commit
d47ada16bc
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user