mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 16:31:05 +02:00
Preparing the input classes for Lua
- Add non locale variants for CExtendedInput, CStringInput,
CStringInputSMS, CPINInput
THX Martii
Origin commit data
------------------
Branch: ni/coolstream
Commit: 31842369cc
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2014-01-18 (Sat, 18 Jan 2014)
Origin message was:
------------------
Preparing the input classes for Lua
- Add non locale variants for CExtendedInput, CStringInput,
CStringInputSMS, CPINInput
THX Martii
------------------
This commit was generated by Migit
This commit is contained in:
@@ -230,42 +230,26 @@ int COsdSetup::exec(CMenuTarget* parent, const std::string &actionKey)
|
||||
else if (actionKey == "font_scaling") {
|
||||
int xre = g_settings.screen_xres;
|
||||
int yre = g_settings.screen_yres;
|
||||
char val_x[4] = {0};
|
||||
char val_y[4] = {0};
|
||||
snprintf(val_x,sizeof(val_x), "%03d",g_settings.screen_xres);
|
||||
snprintf(val_y,sizeof(val_y), "%03d",g_settings.screen_yres);
|
||||
|
||||
CMenuWidget fontscale(LOCALE_FONTMENU_HEAD, NEUTRINO_ICON_COLORS, width, MN_WIDGET_ID_OSDSETUP_FONTSCALE);
|
||||
fontscale.addIntroItems(LOCALE_FONTMENU_SCALING);
|
||||
|
||||
CStringInput xres_count(LOCALE_FONTMENU_SCALING_X, val_x,50,200, 3, LOCALE_FONTMENU_SCALING, LOCALE_FONTMENU_SCALING_X_HINT2, "0123456789 ");
|
||||
CMenuForwarder *m_x = new CMenuForwarder(LOCALE_FONTMENU_SCALING_X, true, val_x, &xres_count);
|
||||
CMenuOptionNumberChooser* mc = new CMenuOptionNumberChooser(LOCALE_FONTMENU_SCALING_X, &g_settings.screen_xres, true, 50, 200, this);
|
||||
mc->setNumericInput(true);
|
||||
mc->setNumberFormat("%d%%");
|
||||
fontscale.addItem(mc);
|
||||
|
||||
CStringInput yres_count(LOCALE_FONTMENU_SCALING_Y, val_y,50,200, 3, LOCALE_FONTMENU_SCALING, LOCALE_FONTMENU_SCALING_Y_HINT2, "0123456789 ");
|
||||
CMenuForwarder *m_y = new CMenuForwarder(LOCALE_FONTMENU_SCALING_Y, true, val_y, &yres_count);
|
||||
mc = new CMenuOptionNumberChooser(LOCALE_FONTMENU_SCALING_Y, &g_settings.screen_yres, true, 50, 200, this);
|
||||
mc->setNumericInput(true);
|
||||
mc->setNumberFormat("%d%%");
|
||||
fontscale.addItem(mc);
|
||||
|
||||
fontscale.addItem(m_x);
|
||||
fontscale.addItem(m_y);
|
||||
res = fontscale.exec(NULL, "");
|
||||
xre = atoi(val_x);
|
||||
yre = atoi(val_y);
|
||||
//fallback for min/max bugs ;)
|
||||
if( xre < 50 || xre > 200 ){
|
||||
xre = g_settings.screen_xres;
|
||||
snprintf(val_x,sizeof(val_x), "%03d",g_settings.screen_xres);
|
||||
}
|
||||
if( yre < 50 || yre > 200 ){
|
||||
yre = g_settings.screen_yres;
|
||||
snprintf(val_y,sizeof(val_y), "%03d",g_settings.screen_yres);
|
||||
}
|
||||
|
||||
if (xre != g_settings.screen_xres || yre != g_settings.screen_yres) {
|
||||
printf("[neutrino] new font scale settings x: %d%% y: %d%%\n", xre, yre);
|
||||
g_settings.screen_xres = xre;
|
||||
g_settings.screen_yres = yre;
|
||||
printf("[neutrino] new font scale settings x: %d%% y: %d%%\n", g_settings.screen_xres, g_settings.screen_yres);
|
||||
CNeutrinoApp::getInstance()->SetupFonts(CNeutrinoFonts::FONTSETUP_NEUTRINO_FONT | CNeutrinoFonts::FONTSETUP_NEUTRINO_FONT_INST);
|
||||
}
|
||||
//return menu_return::RETURN_REPAINT;
|
||||
return res;
|
||||
}
|
||||
else if(actionKey=="window_size") {
|
||||
|
Reference in New Issue
Block a user