mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-30 08:51:04 +02:00
CComponentsHeader: add member initCCButtonFormSize()
This moves caclulation from initCCHeaderButtons() to its own
member.
Origin commit data
------------------
Branch: ni/coolstream
Commit: 41165d7cb2
Author: Thilo Graf <dbt@novatux.de>
Date: 2012-11-24 (Sat, 24 Nov 2012)
------------------
This commit was generated by Migit
This commit is contained in:
@@ -506,6 +506,7 @@ class CComponentsHeader : public CComponentsForm
|
||||
void initCCHeaderButtons();
|
||||
void initCCHItems();
|
||||
void initCCHDefaultButtons();
|
||||
void initCCButtonFormSize();
|
||||
|
||||
protected:
|
||||
void initVarHeader();
|
||||
|
@@ -1831,6 +1831,17 @@ void CComponentsHeader::initCCHDefaultButtons()
|
||||
v_cch_btn.push_back(NEUTRINO_ICON_BUTTON_MENU);
|
||||
}
|
||||
|
||||
// calculate minimal width of icon form
|
||||
void CComponentsHeader::initCCButtonFormSize()
|
||||
{
|
||||
ccif_width = 0;
|
||||
for(size_t i=0; i<v_cch_btn.size(); i++){
|
||||
int bw, bh;
|
||||
frameBuffer->getIconSize(v_cch_btn[i].c_str(), &bw, &bh);
|
||||
ccif_width += (bw + cch_btn_offset);
|
||||
}
|
||||
}
|
||||
|
||||
void CComponentsHeader::initCCHeaderButtons()
|
||||
{
|
||||
initCCHDefaultButtons();
|
||||
@@ -1839,14 +1850,7 @@ void CComponentsHeader::initCCHeaderButtons()
|
||||
if (v_cch_btn.empty())
|
||||
return;
|
||||
|
||||
// calculate minimal width of icon form
|
||||
size_t btncnt = v_cch_btn.size();
|
||||
ccif_width = 0;
|
||||
for(size_t i=0; i<btncnt; i++){
|
||||
int bw, bh;
|
||||
frameBuffer->getIconSize(v_cch_btn[i].c_str(), &bw, &bh);
|
||||
ccif_width += (bw + cch_btn_offset);
|
||||
}
|
||||
initCCButtonFormSize();
|
||||
|
||||
cch_btn_obj = new CComponentsIconForm();
|
||||
cch_btn_obj->setDimensionsAll(0+width-ccif_width, 0, ccif_width-cch_btn_offset, height);
|
||||
|
Reference in New Issue
Block a user