mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-31 09:21:09 +02:00
CVolumeBar: add missing paint() methode, avoid multiple iitem instances
Origin commit data
------------------
Branch: ni/coolstream
Commit: 54e8802397
Author: Thilo Graf <dbt@novatux.de>
Date: 2017-01-29 (Sun, 29 Jan 2017)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -174,48 +174,49 @@ void CVolumeBar::initVolumeBarItems()
|
|||||||
//init current icon object
|
//init current icon object
|
||||||
void CVolumeBar::initVolumeBarIcon()
|
void CVolumeBar::initVolumeBarIcon()
|
||||||
{
|
{
|
||||||
vb_icon = new CComponentsPicture(vb_icon_x, CC_CENTERED, vb_icon_w, height, NEUTRINO_ICON_VOLUME);
|
if (!vb_icon){
|
||||||
|
vb_icon = new CComponentsPicture(vb_icon_x, CC_CENTERED, vb_icon_w, height, NEUTRINO_ICON_VOLUME);
|
||||||
|
//add icon to container
|
||||||
|
addCCItem(vb_icon);
|
||||||
|
}
|
||||||
|
|
||||||
|
vb_icon->setDimensionsAll(vb_icon_x, CC_CENTERED, vb_icon_w, height);
|
||||||
vb_icon->setColorBody(col_body);
|
vb_icon->setColorBody(col_body);
|
||||||
vb_icon->setCorner(corner_rad, CORNER_LEFT);
|
vb_icon->setCorner(corner_rad, CORNER_LEFT);
|
||||||
|
|
||||||
//add icon to container
|
|
||||||
addCCItem(vb_icon);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//create new scale
|
//create new scale
|
||||||
void CVolumeBar::initVolumeBarScale()
|
void CVolumeBar::initVolumeBarScale()
|
||||||
{
|
{
|
||||||
vb_pb = new CProgressBar();
|
if (!vb_pb){
|
||||||
|
vb_pb = new CProgressBar();
|
||||||
|
//add progressbar to container
|
||||||
|
addCCItem(vb_pb);
|
||||||
|
}
|
||||||
|
|
||||||
vb_pb->setType(CProgressBar::PB_REDRIGHT);
|
vb_pb->setType(CProgressBar::PB_REDRIGHT);
|
||||||
vb_pb->setRgb(85, 75, 100);
|
vb_pb->setRgb(85, 75, 100);
|
||||||
vb_pb->setFrameThickness(2);
|
vb_pb->setFrameThickness(2);
|
||||||
vb_pb->setProgress(vb_pbx, vb_pby, vb_pbw, vb_pbh, *vb_vol, 100);
|
vb_pb->setProgress(vb_pbx, vb_pby, vb_pbw, vb_pbh, *vb_vol, 100);
|
||||||
|
|
||||||
//add progressbar to container
|
|
||||||
addCCItem(vb_pb);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//set digit text with current volume value
|
//set digit text with current volume value
|
||||||
void CVolumeBar::initVolumeBarDigitValue()
|
void CVolumeBar::initVolumeBarDigitValue()
|
||||||
{
|
{
|
||||||
|
vb_digit->kill(col_body);
|
||||||
vb_digit->setText(*vb_vol ,vb_digit_mode, *(CVolumeHelper::getInstance()->vb_font));
|
vb_digit->setText(*vb_vol ,vb_digit_mode, *(CVolumeHelper::getInstance()->vb_font));
|
||||||
}
|
}
|
||||||
|
|
||||||
//create digit
|
//create digit
|
||||||
void CVolumeBar::initVolumeBarDigit()
|
void CVolumeBar::initVolumeBarDigit()
|
||||||
{
|
{
|
||||||
vb_digit = new CComponentsLabel();
|
if (!vb_digit)
|
||||||
|
vb_digit = new CComponentsLabel(this);
|
||||||
|
|
||||||
vb_digit->setDimensionsAll(vb_digit_x, 0, vb_digit_w, height);
|
vb_digit->setDimensionsAll(vb_digit_x, 0, vb_digit_w, height);
|
||||||
vb_digit->setTextColor(COL_MENUCONTENT_TEXT);
|
vb_digit->setTextColor(COL_MENUCONTENT_TEXT);
|
||||||
vb_digit->setCorner(corner_rad, CORNER_RIGHT);
|
vb_digit->setCorner(corner_rad, CORNER_RIGHT);
|
||||||
vb_digit->doPaintTextBoxBg(true);
|
|
||||||
initVolumeBarDigitValue();
|
initVolumeBarDigitValue();
|
||||||
|
|
||||||
//add digit label to container
|
|
||||||
addCCItem(vb_digit);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//refresh and paint digit
|
//refresh and paint digit
|
||||||
@@ -244,6 +245,18 @@ void CVolumeBar::paintVolScale()
|
|||||||
vb_pb->paint(CC_SAVE_SCREEN_NO);
|
vb_pb->paint(CC_SAVE_SCREEN_NO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CVolumeBar::paint(bool do_save_bg)
|
||||||
|
{
|
||||||
|
//prepare items
|
||||||
|
initVolumeBarItems();
|
||||||
|
|
||||||
|
//paint form contents
|
||||||
|
if (!is_painted)
|
||||||
|
CComponentsForm::paint(do_save_bg);
|
||||||
|
else
|
||||||
|
repaintVolScale();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// CVolumeHelper ####################################################################################################
|
// CVolumeHelper ####################################################################################################
|
||||||
|
@@ -89,6 +89,7 @@ class CVolumeBar : public CComponentsForm
|
|||||||
// ~CVolumeBar(); inherited from CComponentsForm
|
// ~CVolumeBar(); inherited from CComponentsForm
|
||||||
|
|
||||||
void repaintVolScale();
|
void repaintVolScale();
|
||||||
|
void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user