CProgressWindow: small optimize of size handling

This commit is contained in:
2017-03-03 09:10:40 +01:00
parent 4d50172fbd
commit a9a09541e0

View File

@@ -99,8 +99,7 @@ void CProgressWindow::Init( signal<void, size_t, size_t, string> *statusSignal,
//set window height //set window height
h_height = ccw_head->getHeight(); h_height = ccw_head->getHeight();
ccw_body->setHeight((OFFSET_INNER_MID + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight())*ccw_body->size()); ccw_body->setHeight(ccw_body->back()->getYPos()+ ccw_body->back()->getHeight()+ OFFSET_INNER_MID);
height = max(height, ccw_body->getHeight() + h_height); height = max(height, ccw_body->getHeight() + h_height);
//set position on screen //set position on screen
@@ -112,8 +111,8 @@ CProgressBar* CProgressWindow::getProgressItem()
CProgressBar *pBar = new CProgressBar(); CProgressBar *pBar = new CProgressBar();
pBar->allowPaint(false); pBar->allowPaint(false);
int y_tmp = 0; int y_tmp = 0;
for(size_t i = 0; i< ccw_body->size(); i++){ for(size_t i = ccw_body->size()-1; i< ccw_body->size(); i++){
y_tmp += ccw_body->getCCItem(i)->getHeight(); y_tmp += ccw_body->getCCItem(i)->getYPos() + ccw_body->getCCItem(i)->getHeight();
y_tmp += OFFSET_INNER_MID; y_tmp += OFFSET_INNER_MID;
} }
pBar->setDimensionsAll(OFFSET_INNER_MID, y_tmp, width-2*OFFSET_INNER_MID, g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight()); pBar->setDimensionsAll(OFFSET_INNER_MID, y_tmp, width-2*OFFSET_INNER_MID, g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight());