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:
@@ -193,7 +193,9 @@ BOptionPopUp::AllAttached()
|
|||||||
BMenu* menu = fMenuField->Menu();
|
BMenu* menu = fMenuField->Menu();
|
||||||
if (menu != NULL) {
|
if (menu != NULL) {
|
||||||
float labelWidth = fMenuField->StringWidth(fMenuField->Label());
|
float labelWidth = fMenuField->StringWidth(fMenuField->Label());
|
||||||
fMenuField->SetDivider(labelWidth + kLabelSpace);
|
if (labelWidth > 0.f)
|
||||||
|
labelWidth += kLabelSapce;
|
||||||
|
fMenuField->SetDivider(labelWidth);
|
||||||
menu->SetTargetForItems(this);
|
menu->SetTargetForItems(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user