mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 08:21:07 +02:00
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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user