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

@@ -256,6 +256,8 @@ ci.reset_standby Reset nach Standby
ci.settings Zugangskontrolle
ci.timeout CAM antwortet nicht
ci.waiting Warte auf CAM-Antwort
clock_size Info Uhr
clock_size_height Höhe der Anzeige
clock_switch_off Uhr ausblenden
clock_switch_on Uhr einblenden
colorchooser.alpha alpha
@@ -810,6 +812,7 @@ menu.hint_channellist_foot Definiert, welche Informationen im unteren Sendungsfe
menu.hint_channellist_setup Wählen Sie die Anzeigeoptionen für die Kanalliste
menu.hint_channels Kanalliste öffnen
menu.hint_ci Conditional-Access-Menü zum Einrichten Ihres CI-Moduls oder der eingebetteten Conax-Karte
menu.hint_clock_size Stellen Sie die Größe der Info Uhr ein.
menu.hint_colors Konfigurieren Sie die Menü-Farben
menu.hint_content_back Ändern Sie die Hintergrundfarbe für den Fensterinhalt
menu.hint_content_textcolor Ändern Sie die Textfarbe für den Fensterinhalt
@@ -874,6 +877,7 @@ menu.hint_infobar_sat Zeigt die aktuellen Satelliten- oder Kabel-Provider
menu.hint_infobar_setup Wählen Sie die Anzeigeoptionen für die Infobar aus
menu.hint_infobar_textcolor Ändern Sie die Textfarbe für die Infobar
menu.hint_infobar_tuner Zeigt den aktiven Tuner als Nummernicon
menu.hint_infoclock_setup Wählen Sie die Anzeigeoptionen für die Info Uhr
menu.hint_keep_numbers Mit der Aktivierung werden den Sendern feste/dauerhafte Kanalnummern zugewiesen
menu.hint_key_addrecord Weisen Sie eine Taste für das Starten und Markieren von Aufnahmen im EPG zu
menu.hint_key_addremind Weisen Sie eine Taste für das Umschalten im EPG über den Timer zu
@@ -1240,6 +1244,7 @@ miscsettings.infobar_show_res Auflösung anzeigen
miscsettings.infobar_show_res_simple einfach
miscsettings.infobar_show_sysfs_hdd Füllstandanzeige (sysFS & hdd)
miscsettings.infobar_show_tuner Aktiven Tuner anzeigen
miscsettings.infoclock Info Uhr
miscsettings.progressbar Fortschrittsbalken
miscsettings.progressbar_color Farbe
miscsettings.progressbar_design Design

View File

@@ -256,6 +256,8 @@ ci.reset_standby Reset after standby
ci.settings Conditional access
ci.timeout Timeout waiting CI menu ready
ci.waiting Waiting for CI answer
clock_size Info clock
clock_size_height Display height
clock_switch_off Clock off
clock_switch_on Clock on
colorchooser.alpha alpha
@@ -810,6 +812,7 @@ menu.hint_channellist_foot Show additional information\nin bottom box
menu.hint_channellist_setup Configure channel list GUI options
menu.hint_channels Open channel list
menu.hint_ci Conditional access menu\nto setup your CI CAM or embeded Conax card
menu.hint_clock_size Set the size of the info clock.
menu.hint_colors Configure GUI colors
menu.hint_content_back Change GUI window background color
menu.hint_content_textcolor Change GUI window text color
@@ -874,6 +877,7 @@ menu.hint_infobar_sat Show current satellite or cable provider
menu.hint_infobar_setup Configure infobar options
menu.hint_infobar_textcolor Change infobar text color
menu.hint_infobar_tuner Show active tuner number icon
menu.hint_infoclock_setup Configure info clock GUI options
menu.hint_keep_numbers Keep channel numbers over next scans\nand bouquets editing
menu.hint_key_addrecord Assign button to add record timer\nfrom event list
menu.hint_key_addremind Assign button to add zap timer\nfrom event list
@@ -1240,6 +1244,7 @@ miscsettings.infobar_show_res show resolution on infobar
miscsettings.infobar_show_res_simple simple
miscsettings.infobar_show_sysfs_hdd Fill level (sysFS & hdd)
miscsettings.infobar_show_tuner Display active tuner
miscsettings.infoclock Info clock
miscsettings.progressbar Progressbar
miscsettings.progressbar_color Color
miscsettings.progressbar_design Design

View File

@@ -51,12 +51,16 @@ CInfoClock* CInfoClock::getInstance()
void CInfoClock::initVarInfoClock()
{
setClockFont(SNeutrinoSettings::FONT_TYPE_MENU_TITLE);
Init();
}
void CInfoClock::Init()
{
static int oldSize = 0;
if (oldSize != g_settings.infoClockFontSize) {
oldSize = g_settings.infoClockFontSize;
setClockFontSize(g_settings.infoClockFontSize);
}
int x_old = x, y_old = y, width_old = width, height_old = height;
CVolumeHelper::getInstance()->refresh(cl_font);
CVolumeHelper::getInstance()->getInfoClockDimensions(&x, &y, &width, &height);

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))

View File

@@ -68,6 +68,7 @@ class COsdSetup : public CMenuTarget, public CChangeObserver
void showOsdChanlistSetup(CMenuWidget *menu_chanlist);
void showOsdEventlistSetup(CMenuWidget *menu_eventlist);
void showOsdVolumeSetup(CMenuWidget *menu_volume);
void showOsdInfoclockSetup(CMenuWidget *menu_infoclock);
void showOsdScreenShotSetup(CMenuWidget *menu_screenshot);
void paintWindowSize(int w, int h);

View File

@@ -821,6 +821,9 @@ int CNeutrinoApp::loadSetup(const char * fname)
g_settings.pip_width = configfile.getInt32("pip_width", 365);
g_settings.pip_height = configfile.getInt32("pip_height", 200);
#endif
g_settings.infoClockFontSize = configfile.getInt32("infoClockFontSize", 34);
if(erg)
configfile.setModifiedFlag(true);
return erg;
@@ -1237,6 +1240,7 @@ void CNeutrinoApp::saveSetup(const char * fname)
configfile.setInt32("pip_width", g_settings.pip_width);
configfile.setInt32("pip_height", g_settings.pip_height);
#endif
configfile.setInt32("infoClockFontSize", g_settings.infoClockFontSize);
configfile.setInt32("easymenu", g_settings.easymenu);
if(strcmp(fname, NEUTRINO_SETTINGS_FILE))
configfile.saveConfig(fname);

View File

@@ -64,6 +64,7 @@ enum MN_WIDGET_ID
MN_WIDGET_ID_OSDSETUP_TIMEOUT,
MN_WIDGET_ID_OSDSETUP_SCREENSHOT,
MN_WIDGET_ID_OSDSETUP_VOLUME,
MN_WIDGET_ID_OSDSETUP_INFOCLOCK,
//actually it does not matter, but these 6 entries must be the same order as in menu
MN_WIDGET_ID_OSDSETUP_FONTSIZE_MENU,
MN_WIDGET_ID_OSDSETUP_FONTSIZE_CHANNELLIST,

View File

@@ -283,6 +283,8 @@ typedef enum
LOCALE_CI_SETTINGS,
LOCALE_CI_TIMEOUT,
LOCALE_CI_WAITING,
LOCALE_CLOCK_SIZE,
LOCALE_CLOCK_SIZE_HEIGHT,
LOCALE_CLOCK_SWITCH_OFF,
LOCALE_CLOCK_SWITCH_ON,
LOCALE_COLORCHOOSER_ALPHA,
@@ -837,6 +839,7 @@ typedef enum
LOCALE_MENU_HINT_CHANNELLIST_SETUP,
LOCALE_MENU_HINT_CHANNELS,
LOCALE_MENU_HINT_CI,
LOCALE_MENU_HINT_CLOCK_SIZE,
LOCALE_MENU_HINT_COLORS,
LOCALE_MENU_HINT_CONTENT_BACK,
LOCALE_MENU_HINT_CONTENT_TEXTCOLOR,
@@ -901,6 +904,7 @@ typedef enum
LOCALE_MENU_HINT_INFOBAR_SETUP,
LOCALE_MENU_HINT_INFOBAR_TEXTCOLOR,
LOCALE_MENU_HINT_INFOBAR_TUNER,
LOCALE_MENU_HINT_INFOCLOCK_SETUP,
LOCALE_MENU_HINT_KEEP_NUMBERS,
LOCALE_MENU_HINT_KEY_ADDRECORD,
LOCALE_MENU_HINT_KEY_ADDREMIND,
@@ -1267,6 +1271,7 @@ typedef enum
LOCALE_MISCSETTINGS_INFOBAR_SHOW_RES_SIMPLE,
LOCALE_MISCSETTINGS_INFOBAR_SHOW_SYSFS_HDD,
LOCALE_MISCSETTINGS_INFOBAR_SHOW_TUNER,
LOCALE_MISCSETTINGS_INFOCLOCK,
LOCALE_MISCSETTINGS_PROGRESSBAR,
LOCALE_MISCSETTINGS_PROGRESSBAR_COLOR,
LOCALE_MISCSETTINGS_PROGRESSBAR_DESIGN,

View File

@@ -283,6 +283,8 @@ const char * locale_real_names[] =
"ci.settings",
"ci.timeout",
"ci.waiting",
"clock_size",
"clock_size_height",
"clock_switch_off",
"clock_switch_on",
"colorchooser.alpha",
@@ -837,6 +839,7 @@ const char * locale_real_names[] =
"menu.hint_channellist_setup",
"menu.hint_channels",
"menu.hint_ci",
"menu.hint_clock_size",
"menu.hint_colors",
"menu.hint_content_back",
"menu.hint_content_textcolor",
@@ -901,6 +904,7 @@ const char * locale_real_names[] =
"menu.hint_infobar_setup",
"menu.hint_infobar_textcolor",
"menu.hint_infobar_tuner",
"menu.hint_infoclock_setup",
"menu.hint_keep_numbers",
"menu.hint_key_addrecord",
"menu.hint_key_addremind",
@@ -1267,6 +1271,7 @@ const char * locale_real_names[] =
"miscsettings.infobar_show_res_simple",
"miscsettings.infobar_show_sysfs_hdd",
"miscsettings.infobar_show_tuner",
"miscsettings.infoclock",
"miscsettings.progressbar",
"miscsettings.progressbar_color",
"miscsettings.progressbar_design",

View File

@@ -52,7 +52,6 @@
#include <global.h>
#include <neutrino.h>
#include <gui/widget/stringinput.h>
#include <gui/audiomute.h>
#include <gui/infoclock.h>
#include <driver/volume.h>
#include <system/helpers.h>
@@ -322,10 +321,6 @@ bool CFontSizeNotifier::changeNotify(const neutrino_locale_t, void *)
hintBox.hide();
/* recalculate infoclock/muteicon/volumebar */
CVolumeHelper::getInstance()->refresh();
if (CNeutrinoApp::getInstance()->isMuted()) {
CAudioMute::getInstance()->enableMuteIcon(false);
CAudioMute::getInstance()->enableMuteIcon(true);
}
return true;
}

View File

@@ -538,6 +538,8 @@ struct SNeutrinoSettings
FONT_TYPE_COUNT
};
int infoClockFontSize;
// lcdd
enum LCD_SETTINGS {
LCD_BRIGHTNESS = 0,