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