CInfoClock: Use dynamic font for display

Origin commit data
------------------
Branch: ni/coolstream
Commit: 435d25c0ce
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2013-11-27 (Wed, 27 Nov 2013)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
Michael Liebmann
2013-11-27 04:02:01 +01:00
parent e000305768
commit bfb4babf6b
11 changed files with 70 additions and 6 deletions

View File

@@ -45,6 +45,8 @@
#include "filebrowser.h"
#include "osd_progressbar_setup.h"
#include <gui/audiomute.h>
#include <gui/infoclock.h>
#include <gui/widget/icons.h>
#include <gui/widget/colorchooser.h>
#include <gui/widget/stringinput.h>
@@ -545,6 +547,13 @@ int COsdSetup::showOsdSetup()
mf->setHint("", LOCALE_MENU_HINT_VOLUME);
osd_menu->addItem(mf);
//info clock
CMenuWidget osd_menu_infoclock(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_OSDSETUP_INFOCLOCK);
showOsdInfoclockSetup(&osd_menu_infoclock);
mf = new CMenuForwarder(LOCALE_MISCSETTINGS_INFOCLOCK, true, NULL, &osd_menu_infoclock, NULL, CRCInput::convertDigitToKey(shortcut++));
mf->setHint("", LOCALE_MENU_HINT_INFOCLOCK_SETUP);
osd_menu->addItem(mf);
//screenshot
CMenuWidget osd_menu_screenshot(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_OSDSETUP_SCREENSHOT);
showOsdScreenShotSetup(&osd_menu_screenshot);
@@ -590,12 +599,22 @@ int COsdSetup::showOsdSetup()
osd_menu->addItem(mc);
int oldVolumeSize = g_settings.volume_size;
int oldInfoClockSize = g_settings.infoClockFontSize;
int res = osd_menu->exec(NULL, "");
if (oldVolumeSize != g_settings.volume_size)
CVolumeHelper::getInstance()->refresh();
if (oldInfoClockSize != g_settings.infoClockFontSize) {
CInfoClock::getInstance()->setClockFontSize(g_settings.infoClockFontSize);
CVolumeHelper::getInstance()->refresh();
if (CNeutrinoApp::getInstance()->isMuted()) {
CAudioMute::getInstance()->enableMuteIcon(false);
CAudioMute::getInstance()->enableMuteIcon(true);
}
}
delete osd_menu;
return res;
}
@@ -785,6 +804,13 @@ void COsdSetup::showOsdFontSizeSetup(CMenuWidget *menu_fonts)
fontSettings->addItem(mf);
w_index++;
}
#if 0
// size of info clock
fontSettings->addItem(GenericMenuSeparatorLine);
CMenuOptionNumberChooser* mn = new CMenuOptionNumberChooser(LOCALE_CLOCK_SIZE, &g_settings.infoClockFontSize, true, 30, 120);
mn->setHint("", LOCALE_MENU_HINT_CLOCK_SIZE);
fontSettings->addItem(mn);
#endif
}
//osd timeouts
@@ -982,6 +1008,17 @@ void COsdSetup::showOsdVolumeSetup(CMenuWidget *menu_volume)
menu_volume->addItem(mc);
}
//info clock
void COsdSetup::showOsdInfoclockSetup(CMenuWidget *menu_infoclock)
{
menu_infoclock->addIntroItems(LOCALE_MISCSETTINGS_INFOCLOCK);
// size of info clock
CMenuOptionNumberChooser* mn = new CMenuOptionNumberChooser(LOCALE_CLOCK_SIZE_HEIGHT, &g_settings.infoClockFontSize, true, 30, 120);
mn->setHint("", LOCALE_MENU_HINT_CLOCK_SIZE);
menu_infoclock->addItem(mn);
}
bool COsdSetup::changeNotify(const neutrino_locale_t OptionName, void * data)
{
if(ARE_LOCALES_EQUAL(OptionName, LOCALE_COLORMENU_CONTRAST_FONTS))