CInfoClock: Fix paint info clock when mute icon is displayed

Origin commit data
------------------
Commit: 6a5d335430
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2013-11-20 (Wed, 20 Nov 2013)
This commit is contained in:
Michael Liebmann
2013-11-20 05:49:44 +01:00
parent a2967e2488
commit db1a003584
4 changed files with 24 additions and 2 deletions

View File

@@ -31,7 +31,6 @@
#include <global.h>
#include <neutrino.h>
// #include <driver/volume.h>
#include <gui/volumebar.h>
#include <gui/infoclock.h>
@@ -82,3 +81,16 @@ 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();
setXPos(x);
//prepare items before paint
initCCLockItems();
//paint the clock
paintForm(do_save_bg);
}

View File

@@ -46,6 +46,7 @@ class CInfoClock : public CComponentsFrmClock
bool StartClock();
bool StopClock();
void ClearDisplay();
void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
};
#endif

View File

@@ -340,6 +340,14 @@ void CVolumeHelper::initVolBarSize()
}
}
int CVolumeHelper::getInfoClockX()
{
if (CNeutrinoApp::getInstance()->isMuted())
return clock_ax - mute_dx - h_spacer;
else
return clock_ax;
}
void CVolumeHelper::refresh()
{
Init();

View File

@@ -123,7 +123,8 @@ class CVolumeHelper
int getVolIconHeight() {return icon_height;}
void getDimensions(int *_x, int *_y, int *_sw, int *_sh, int *_iw, int *_dw) { *_x = x; *_y = y; *_sw = sw; *_sh = sh; *_iw = icon_width; *_dw = digit_width; }
void getMuteIconDimensions(int *_x, int *_y, int *w, int *h) { *_x = mute_ax; *_y = mute_ay+mute_corrY; *w = mute_dx; *h = mute_dy; }
void getInfoClockDimensions(int *_x, int *_y, int *w, int *h/*, int *d_h, int *d_o*/) { *_x = clock_ax; *_y = clock_ay; *w = clock_dx; *h = clock_dy/*, *d_h = digit_h, *d_o = digit_offset*/; }
int getInfoClockX();
void getInfoClockDimensions(int *_x, int *_y, int *w, int *h) { *_x = getInfoClockX(); *_y = clock_ay; *w = clock_dx; *h = clock_dy; }
void getVolBarDimensions(int *_y, int *_dy) { *_y = vol_ay; *_dy = vol_height; }
void setMuteIconCorrY(int corr) { mute_corrY = corr; }
void refresh();