diff --git a/src/gui/infoclock.cpp b/src/gui/infoclock.cpp index 621c9f9cc..876cce7b7 100644 --- a/src/gui/infoclock.cpp +++ b/src/gui/infoclock.cpp @@ -31,7 +31,6 @@ #include #include -// #include #include #include @@ -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); +} diff --git a/src/gui/infoclock.h b/src/gui/infoclock.h index 18899e2b4..ffa67fb20 100644 --- a/src/gui/infoclock.h +++ b/src/gui/infoclock.h @@ -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 diff --git a/src/gui/volumebar.cpp b/src/gui/volumebar.cpp index 3b8445fe7..755489e93 100644 --- a/src/gui/volumebar.cpp +++ b/src/gui/volumebar.cpp @@ -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(); diff --git a/src/gui/volumebar.h b/src/gui/volumebar.h index d6a43b4e8..ccf7901e3 100644 --- a/src/gui/volumebar.h +++ b/src/gui/volumebar.h @@ -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();