FontDemo: fix overwriting of family with style.

Menus were wrongly set to SetLabelFromMarked (probably from a previous
version of the UI without the nested font menu).

Fixes #11517.
This commit is contained in:
Adrien Destugues 2014-11-28 10:45:36 +01:00
parent 2462ab577d
commit 122fdeece7

View File

@ -358,6 +358,7 @@ ControlView::_UpdateFontmenus(bool setInitialfont)
for (int32 i = 0; i < fontfamilies; i++) {
if (get_font_family(i, &fontFamilyName) == B_OK) {
stylemenu = new BPopUpMenu(fontFamilyName);
stylemenu->SetLabelFromMarked(false);
const int32 styles = count_font_styles(fontFamilyName);
BMessage* familyMsg = new BMessage(FONTFAMILY_CHANGED_MSG);
@ -390,12 +391,13 @@ ControlView::_UpdateFontmenus(bool setInitialfont)
stylemenu->AddItem(styleItem);
}
}
}
stylemenu->SetRadioMode(true);
stylemenu->SetTargetForItems(this);
}
}
fFontFamilyMenu->SetLabelFromMarked(true);
fFontFamilyMenu->SetLabelFromMarked(false);
fFontFamilyMenu->SetTargetForItems(this);
}
@ -405,11 +407,11 @@ ControlView::_AddFontMenu()
{
fFontFamilyMenu = new BPopUpMenu("fontfamlilymenu");
_UpdateFontmenus(true);
fFontMenuField = new BMenuField("FontMenuField",
B_TRANSLATE("Font:"), fFontFamilyMenu);
AddChild(fFontMenuField);
_UpdateFontmenus(true);
}