mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 07:51:19 +02:00
CProgressWindow: reassign y position of body items on disabled header
This commit is contained in:
@@ -82,7 +82,8 @@ void CProgressWindow::Init()
|
||||
addWindowItem(global_bar);
|
||||
y_item += 2*h_pbar;
|
||||
|
||||
height = y_item + ccw_head->getHeight();
|
||||
h_height = ccw_head->getHeight();
|
||||
height = y_item + h_height;
|
||||
|
||||
setCenterPos();
|
||||
}
|
||||
@@ -96,6 +97,18 @@ void CProgressWindow::setTitle(const neutrino_locale_t title)
|
||||
#endif // VFD_UPDATE
|
||||
}
|
||||
|
||||
//if header is disabled we need new position for body items
|
||||
void CProgressWindow::fitItems()
|
||||
{
|
||||
if (ccw_show_header)
|
||||
return;
|
||||
|
||||
for(size_t i=0; i<ccw_body->size() ;i++){
|
||||
int y_item = ccw_body->getCCItem(i)->getYPos() + h_height - 10;
|
||||
ccw_body->getCCItem(i)->setYPos(y_item);
|
||||
}
|
||||
}
|
||||
|
||||
void CProgressWindow::showStatus(const unsigned int prog)
|
||||
{
|
||||
if (global_progress == prog)
|
||||
@@ -177,3 +190,9 @@ int CProgressWindow::exec(CMenuTarget* parent, const std::string & /*actionKey*/
|
||||
|
||||
return menu_return::RETURN_REPAINT;
|
||||
}
|
||||
|
||||
void CProgressWindow::paint(bool do_save_bg)
|
||||
{
|
||||
fitItems();
|
||||
CComponentsWindow::paint(do_save_bg);
|
||||
}
|
||||
|
@@ -37,8 +37,9 @@ class CProgressWindow : public CComponentsWindow, public CMenuTarget
|
||||
unsigned int global_progress;
|
||||
unsigned int local_progress;
|
||||
int w_bar_frame;
|
||||
|
||||
int h_height;
|
||||
void Init();
|
||||
void fitItems();
|
||||
|
||||
public:
|
||||
|
||||
@@ -53,6 +54,7 @@ class CProgressWindow : public CComponentsWindow, public CMenuTarget
|
||||
unsigned int getGlobalStatus(void);
|
||||
void showLocalStatus(const unsigned int prog);
|
||||
void showStatusMessageUTF(const std::string & text); // UTF-8
|
||||
void paint(bool do_save_bg = true);
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user