mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 00:41:17 +02:00
CInfoClock: Fix paint info clock when mute icon is displayed
This commit is contained in:
@@ -31,7 +31,6 @@
|
|||||||
|
|
||||||
#include <global.h>
|
#include <global.h>
|
||||||
#include <neutrino.h>
|
#include <neutrino.h>
|
||||||
// #include <driver/volume.h>
|
|
||||||
#include <gui/volumebar.h>
|
#include <gui/volumebar.h>
|
||||||
#include <gui/infoclock.h>
|
#include <gui/infoclock.h>
|
||||||
|
|
||||||
@@ -82,3 +81,16 @@ bool CInfoClock::StopClock()
|
|||||||
|
|
||||||
return ret;
|
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);
|
||||||
|
}
|
||||||
|
@@ -46,6 +46,7 @@ class CInfoClock : public CComponentsFrmClock
|
|||||||
bool StartClock();
|
bool StartClock();
|
||||||
bool StopClock();
|
bool StopClock();
|
||||||
void ClearDisplay();
|
void ClearDisplay();
|
||||||
|
void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -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()
|
void CVolumeHelper::refresh()
|
||||||
{
|
{
|
||||||
Init();
|
Init();
|
||||||
|
@@ -123,7 +123,8 @@ class CVolumeHelper
|
|||||||
int getVolIconHeight() {return icon_height;}
|
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 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 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 getVolBarDimensions(int *_y, int *_dy) { *_y = vol_ay; *_dy = vol_height; }
|
||||||
void setMuteIconCorrY(int corr) { mute_corrY = corr; }
|
void setMuteIconCorrY(int corr) { mute_corrY = corr; }
|
||||||
void refresh();
|
void refresh();
|
||||||
|
Reference in New Issue
Block a user