mirror of
https://projects.vdr-developer.org/git/vdr-plugin-skindesigner.git
synced 2023-10-19 17:58:31 +02:00
fixed bug that new font was displayed first after VDR restart when font was changed in OSD Setup menu
This commit is contained in:
parent
3d1a2f1090
commit
762115bf81
1
HISTORY
1
HISTORY
@ -25,3 +25,4 @@ Version 0.0.2
|
||||
- introduced new viewelement audioinfo in displaychannel
|
||||
- added setup option to choose Menu Item display method between "at one go" and "after one another"
|
||||
- fixed bug that new skin was not properly loaded sometimes when skin was changed in OSD Setup menu
|
||||
- fixed bug that new font was displayed first after VDR restart when font was changed in OSD Setup menu
|
||||
|
26
config.c
26
config.c
@ -23,10 +23,10 @@ cDesignerConfig::cDesignerConfig() {
|
||||
//menu display style, display menu items
|
||||
//one after each other or in one step
|
||||
blockFlush = 1;
|
||||
//remember current skin and theme
|
||||
//remember current skin and theme, osd size and osd fonts
|
||||
SetSkin();
|
||||
//remember osd size
|
||||
SetOSDSize();
|
||||
SetOSDFonts();
|
||||
}
|
||||
|
||||
cDesignerConfig::~cDesignerConfig() {
|
||||
@ -146,6 +146,28 @@ bool cDesignerConfig::OsdSizeChanged(void) {
|
||||
return false;
|
||||
}
|
||||
|
||||
void cDesignerConfig::SetOSDFonts(void) {
|
||||
fontFix = Setup.FontFix;
|
||||
fontOsd = Setup.FontOsd;
|
||||
fontSml = Setup.FontSml;
|
||||
}
|
||||
|
||||
bool cDesignerConfig::OsdFontsChanged(void) {
|
||||
bool changed = false;
|
||||
if (fontFix.compare(Setup.FontFix) != 0) {
|
||||
changed = true;
|
||||
}
|
||||
if (fontOsd.compare(Setup.FontOsd) != 0) {
|
||||
changed = true;
|
||||
}
|
||||
if (fontSml.compare(Setup.FontSml) != 0) {
|
||||
changed = true;
|
||||
}
|
||||
if (changed)
|
||||
SetOSDFonts();
|
||||
return changed;
|
||||
}
|
||||
|
||||
cString cDesignerConfig::CheckSlashAtEnd(std::string path) {
|
||||
try {
|
||||
if (!(path.at(path.size()-1) == '/'))
|
||||
|
5
config.h
5
config.h
@ -19,6 +19,9 @@ private:
|
||||
cRect osdSize;
|
||||
string osdSkin;
|
||||
string osdTheme;
|
||||
string fontFix;
|
||||
string fontOsd;
|
||||
string fontSml;
|
||||
public:
|
||||
cDesignerConfig();
|
||||
~cDesignerConfig();
|
||||
@ -36,6 +39,8 @@ public:
|
||||
bool SkinChanged(void);
|
||||
void SetOSDSize(void);
|
||||
bool OsdSizeChanged(void);
|
||||
void SetOSDFonts(void);
|
||||
bool OsdFontsChanged(void);
|
||||
cString logoExtension;
|
||||
cString skinPath;
|
||||
cString logoPath;
|
||||
|
16
designer.c
16
designer.c
@ -163,6 +163,7 @@ void cSkinDesigner::Init(void) {
|
||||
if (init) {
|
||||
config.SetSkin();
|
||||
config.SetOSDSize();
|
||||
config.SetOSDFonts();
|
||||
}
|
||||
dsyslog("skindesigner: initializing skin %s", skin.c_str());
|
||||
|
||||
@ -188,6 +189,21 @@ void cSkinDesigner::Init(void) {
|
||||
watch.Stop("templates loaded and cache created");
|
||||
}
|
||||
init = false;
|
||||
} else if (config.OsdFontsChanged()) {
|
||||
dsyslog("skindesigner: reloading fonts");
|
||||
if (fontManager)
|
||||
delete fontManager;
|
||||
fontManager = new cFontManager();
|
||||
cStopWatch watch;
|
||||
bool ok = LoadTemplates();
|
||||
if (!ok) {
|
||||
esyslog("skindesigner: error during loading of templates - using LCARS as backup");
|
||||
backupSkin = new cSkinLCARS();
|
||||
useBackupSkin = true;
|
||||
} else {
|
||||
CacheTemplates();
|
||||
watch.Stop("templates loaded and cache created");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user