CInfoClock: Rework calculate size & position

- Fix display info clock
- Preparation for alternative use of neutrino fonts / DynFonts


Origin commit data
------------------
Commit: 0c18d4a6db
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2013-11-26 (Tue, 26 Nov 2013)
This commit is contained in:
Michael Liebmann
2013-11-26 14:08:48 +01:00
parent a33bb55eaa
commit 658f794ef5
6 changed files with 30 additions and 24 deletions

View File

@@ -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;