volumebar font reset after change (thx dboxoldie)

to avoid segfault

Signed-off-by: Thilo Graf <dbt@novatux.de>

picked from Duckbox-Developers/neutrino-mp-cst-next
4365761b2a47e12666154821c2ce982f74ef0627

needs supplements


Origin commit data
------------------
Commit: 1ea12764da
Author: TangoCash <eric@loxat.de>
Date: 2016-12-21 (Wed, 21 Dec 2016)
This commit is contained in:
TangoCash
2016-12-21 10:13:41 +01:00
committed by Thilo Graf
parent c969207000
commit 9dbb076f26
2 changed files with 16 additions and 0 deletions

View File

@@ -34,6 +34,7 @@
#include <neutrino.h>
#include <gui/infoclock.h>
#include <driver/neutrinofonts.h>
#include <system/debug.h>
using namespace std;
@@ -260,9 +261,23 @@ CVolumeHelper::CVolumeHelper()
frameBuffer = CFrameBuffer::getInstance();
CNeutrinoApp::getInstance()->OnAfterSetupFonts.connect(sigc::mem_fun(this, &CVolumeHelper::resetFont));
Init();
}
void CVolumeHelper::resetFont()
{
if (vb_font){
vb_font = NULL;
dprintf(DEBUG_INFO, "\033[33m[CVolumeHelper][%s - %d] reset vb font \033[0m\n", __func__, __LINE__);
}
if (clock_font){
clock_font = NULL;
dprintf(DEBUG_INFO, "\033[33m[CVolumeHelper][%s - %d] reset clock font \033[0m\n", __func__, __LINE__);
}
}
void CVolumeHelper::Init(Font* font)
{

View File

@@ -108,6 +108,7 @@ class CVolumeHelper
Font* clock_font;
CFrameBuffer *frameBuffer;
void resetFont();
void Init(Font* font=NULL);
void initVolBarSize();
void initMuteIcon();