MCPcopy Create free account
hub / github.com/buggins/coolreader / createFontSizeMenu

Method createFontSizeMenu

cr3gui/src/settings.cpp:266–292  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

264};
265
266CRMenu * CRSettingsMenu::createFontSizeMenu( CRGUIWindowManager * wm, CRMenu * mainMenu, CRPropRef props )
267{
268 lString16Collection list;
269 fontMan->getFaceList( list );
270 lString8 fontFace = UnicodeToUtf8(props->getStringDef( PROP_FONT_FACE, UnicodeToUtf8(list[0]).c_str() ));
271 //LVFontRef menuFont( fontMan->GetFont( MENU_FONT_SIZE, 600, false, css_ff_sans_serif, lString8("Arial")) );
272 CRMenuSkinRef skin = wm->getSkin()->getMenuSkin(L"#settings");
273 LVFontRef valueFont = skin->getValueSkin()->getFont();//( fontMan->GetFont( VALUE_FONT_SIZE, 400, true, css_ff_sans_serif, lString8("Arial")) );
274 CRMenu * fontSizeMenu;
275 fontSizeMenu = new FontSizeMenu(_wm, mainMenu, valueFont, props );
276 for ( unsigned i=0; i<sizeof(cr_font_sizes)/sizeof(int); i++ ) {
277 //char name[32];
278 char defvalue[400];
279 //sprintf( name, "VIEWER_DLG_FONT_SIZE_%d", cr_font_sizes[i] );
280 sprintf( defvalue, "%d %s", cr_font_sizes[i], _("The quick brown fox jumps over lazy dog") );
281 fontSizeMenu->addItem( new OnDemandFontMenuItem( fontSizeMenu, 0,
282 lString16(defvalue),
283 LVImageSourceRef(), lString16::itoa(cr_font_sizes[i]).c_str(),
284 cr_font_sizes[i], 400, false, css_ff_sans_serif, fontFace, UnicodeToUtf8(skin->getItemSkin()->getFontFace())) );
285 }
286 fontSizeMenu->setAccelerators( _wm->getAccTables().get("menu") );
287 //fontSizeMenu->setAccelerators( _menuAccelerators );
288 fontSizeMenu->setSkinName(lString16(L"#settings"));
289 //fontSizeMenu->setSkinName(lString16(L"#main"));
290 fontSizeMenu->reconfigure( 0 );
291 return fontSizeMenu;
292}
293
294void CRSettingsMenu::addMenuItems( CRMenu * menu, item_def_t values[] )
295{

Callers 1

showFontSizeMenuMethod · 0.80

Calls 15

UnicodeToUtf8Function · 0.85
lString16Class · 0.85
getMenuSkinMethod · 0.80
getValueSkinMethod · 0.80
getFontFaceMethod · 0.80
getItemSkinMethod · 0.80
setSkinNameMethod · 0.80
getFaceListMethod · 0.45
getStringDefMethod · 0.45
c_strMethod · 0.45
getSkinMethod · 0.45
getFontMethod · 0.45

Tested by

no test coverage detected