diff --git a/src/gui/audiomute.cpp b/src/gui/audiomute.cpp index 90ef21734..f311f8277 100644 --- a/src/gui/audiomute.cpp +++ b/src/gui/audiomute.cpp @@ -62,6 +62,9 @@ void CAudioMute::AudioMute(int newValue, bool isEvent) if( isEvent && ( neutrino->getMode() != CNeutrinoApp::mode_scart ) && ( neutrino->getMode() != CNeutrinoApp::mode_pic)) { + if (doInit) + CVolumeHelper::getInstance()->refresh(); + CVolumeHelper::getInstance()->getMuteIconDimensions(&x, &y, &width, &height); if ((y_old != y)) { if (do_paint_mute_icon) @@ -88,15 +91,13 @@ void CAudioMute::AudioMute(int newValue, bool isEvent) frameBuffer->setFbArea(CFrameBuffer::FB_PAINTAREA_MUTEICON1); } frameBuffer->fbNoCheck(false); - - if (doInit) - CVolumeHelper::getInstance()->refresh(); } } void CAudioMute::enableMuteIcon(bool enable) { CNeutrinoApp *neutrino = CNeutrinoApp::getInstance(); + CVolumeHelper::getInstance()->getMuteIconDimensions(&x, &y, &width, &height); frameBuffer->fbNoCheck(true); if (enable) { frameBuffer->doPaintMuteIcon(true); diff --git a/src/gui/infoclock.cpp b/src/gui/infoclock.cpp index b7e5c4c8e..1b5381588 100644 --- a/src/gui/infoclock.cpp +++ b/src/gui/infoclock.cpp @@ -57,8 +57,18 @@ void CInfoClock::initVarInfoClock() void CInfoClock::Init() { + int x_old = x, y_old = y, width_old = width, height_old = height; + cl_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]; CVolumeHelper::getInstance()->refresh(); CVolumeHelper::getInstance()->getInfoClockDimensions(&x, &y, &width, &height); + if ((x_old != x) || (y_old != y) || (width_old != width) || (height_old != height)) { + cleanCCForm(); + clearCCItems(); + } + + // set corner radius depending on clock height + corner_rad = (g_settings.rounded_corners) ? std::max(height/10, CORNER_RADIUS_SMALL) : 0; + initCCLockItems(); } @@ -82,18 +92,6 @@ bool CInfoClock::StopClock() return ret; } -void CInfoClock::paint(bool do_save_bg) -{ - // calculate current x-position of clock (mute icon on/off) - x = CVolumeHelper::getInstance()->getInfoClockX(); - - //prepare items before paint - initCCLockItems(); - - //paint the clock - paintForm(do_save_bg); -} - bool CInfoClock::enableInfoClock(bool enable) { bool ret = false; diff --git a/src/gui/infoclock.h b/src/gui/infoclock.h index ebefb2686..ebf1b912d 100644 --- a/src/gui/infoclock.h +++ b/src/gui/infoclock.h @@ -47,7 +47,6 @@ class CInfoClock : public CComponentsFrmClock bool StopClock(); bool enableInfoClock(bool enable); void ClearDisplay(); - void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); }; #endif diff --git a/src/gui/volumebar.cpp b/src/gui/volumebar.cpp index 0f55401f5..7d450b367 100644 --- a/src/gui/volumebar.cpp +++ b/src/gui/volumebar.cpp @@ -79,6 +79,7 @@ void CVolumeBar::initVarVolumeBar() void CVolumeBar::initVolumeBarSize() { CVolumeHelper *cvh = CVolumeHelper::getInstance(); + cvh->refresh(); cvh->getSpacer(&h_spacer, &v_spacer); cvh->getDimensions(&x, &y, &sw, &sh, &vb_icon_w, &vb_digit_w); cvh->getVolBarDimensions(&y, &height); @@ -125,7 +126,7 @@ void CVolumeBar::initVolumeBarPosition() if ((neutrino->isMuted()) && (!g_settings.mode_clock)) x_corr = mute_dx + h_spacer; if (g_settings.mode_clock) - y += max(clock_y + clock_height, mute_ay + mute_dy); + y = clock_y + clock_height + v_spacer; } x = sw - width - x_corr; break; @@ -260,6 +261,8 @@ CVolumeHelper::CVolumeHelper() { h_spacer = 11; v_spacer = 6; + vb_font = NULL; + clock_font = NULL; frameBuffer = CFrameBuffer::getInstance(); @@ -273,7 +276,6 @@ void CVolumeHelper::Init() y = frameBuffer->getScreenY() + v_spacer; sw = g_settings.screen_EndX - h_spacer; sh = frameBuffer->getScreenHeight(); - vb_font = NULL; initVolBarSize(); initMuteIcon(); @@ -282,12 +284,12 @@ void CVolumeHelper::Init() void CVolumeHelper::initInfoClock() { - digit_offset = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getDigitOffset(); - digit_h = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getDigitHeight(); - int t1 = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getRenderWidth(widest_number); - int t2 = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getRenderWidth(":"); - clock_dy = digit_h + (int)((float)digit_offset * 1.5); - clock_dx = t1*6 + t2*2; + digit_offset = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getDigitOffset(); + digit_h = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getDigitHeight(); + int t1 = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getRenderWidth(widest_number); + int t2 = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getRenderWidth(":"); + clock_dy = digit_h + (int)((float)digit_offset * 1.3); + clock_dx = t1*7 + t2*2; clock_ax = sw - clock_dx; clock_ay = y; vol_ay = y; diff --git a/src/gui/volumebar.h b/src/gui/volumebar.h index ccf7901e3..d6864b636 100644 --- a/src/gui/volumebar.h +++ b/src/gui/volumebar.h @@ -105,6 +105,7 @@ class CVolumeHelper int icon_width, icon_height, digit_width; int h_spacer, v_spacer; int vol_ay, vol_height; + Font** clock_font; CFrameBuffer *frameBuffer; void Init(); diff --git a/src/system/setting_helpers.cpp b/src/system/setting_helpers.cpp index b2ca12c00..8e8dde7f9 100644 --- a/src/system/setting_helpers.cpp +++ b/src/system/setting_helpers.cpp @@ -52,6 +52,7 @@ #include #include #include +#include #include #include #include @@ -321,6 +322,10 @@ 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; }