diff --git a/data/cables.xml b/data/cables.xml index e05516a44..fa4baec60 100644 --- a/data/cables.xml +++ b/data/cables.xml @@ -534,7 +534,7 @@ - + diff --git a/src/gui/adzap.cpp b/src/gui/adzap.cpp index 0199bc779..bc251f253 100644 --- a/src/gui/adzap.cpp +++ b/src/gui/adzap.cpp @@ -66,15 +66,16 @@ CAdZapMenu::CAdZapMenu() sem_init(&sem, 0, 0); + channelId = -1; + armed = false; + monitor = false; + alerted = false; + pthread_t thr; if (pthread_create(&thr, 0, CAdZapMenu::Run, this)) fprintf(stderr, "ERROR: pthread_create(CAdZapMenu::CAdZapMenu)\n"); else pthread_detach(thr); - channelId = -1; - armed = false; - monitor = false; - alerted = false; } static bool sortByDateTime(const CChannelEvent & a, const CChannelEvent & b) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 7313af3b6..18fad2c50 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -1688,13 +1688,15 @@ void CChannelList::showChannelLogo() { if ((*chanlist).empty()) return; + if(g_settings.channellist_show_channellogo){ header->setChannelLogo((*chanlist)[selected]->getChannelID(), (*chanlist)[selected]->getName()); header->getChannelLogoObject()->hide(); header->getChannelLogoObject()->clearSavedScreen(); - header->getChannelLogoObject()->allowPaint(true); header->getChannelLogoObject()->paint(); } + else + header->setChannelLogo(0, string()); } #define NUM_LIST_BUTTONS_SORT 9 @@ -2154,16 +2156,7 @@ void CChannelList::paintHead() } } - if(g_settings.channellist_show_channellogo){ - //ensure to have clean background - header->getChannelLogoObject()->hide(); - header->setChannelLogo((*chanlist)[selected]->getChannelID(), (*chanlist)[selected]->getName()); - header->getChannelLogoObject()->allowPaint(false); - } - else - header->setChannelLogo(0, string()); header->paint(CC_SAVE_SCREEN_NO); - showChannelLogo(); } CComponentsHeader* CChannelList::getHeaderObject() diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index dbca41d93..078edf940 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -374,15 +374,16 @@ bool CCDraw::clearFbGradientData() for(size_t i =0; i< v_fbdata.size() ;i++) { if (v_fbdata[i].gradient_data){ if (v_fbdata[i].gradient_data->gradientBuf){ + dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], clean up gradientBuf \t %p...\033[0m\n", __func__, __LINE__, v_fbdata[i].gradient_data->gradientBuf); free(v_fbdata[i].gradient_data->gradientBuf); v_fbdata[i].gradient_data->gradientBuf = NULL; - dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], clean up gradientBuf...\033[0m\n", __func__, __LINE__); } if (v_fbdata[i].gradient_data->boxBuf){ + dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], clean up boxBuf \t %p...\033[0m\n", __func__, __LINE__, v_fbdata[i].gradient_data->boxBuf); cs_free_uncached(v_fbdata[i].gradient_data->boxBuf); v_fbdata[i].gradient_data->boxBuf = NULL; - dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], clean up boxBuf...\033[0m\n", __func__, __LINE__); } + dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], clean up gradient data \t %p...\033[0m\n", __func__, __LINE__, v_fbdata[i].gradient_data); delete v_fbdata[i].gradient_data; v_fbdata[i].gradient_data = NULL; ret = true; diff --git a/src/gui/components/cc_frm.h b/src/gui/components/cc_frm.h index 59f488fdb..f1aba0a9c 100644 --- a/src/gui/components/cc_frm.h +++ b/src/gui/components/cc_frm.h @@ -157,7 +157,7 @@ class CComponentsForm : public CComponentsItem ///select a definied item, parameter1 as size_t virtual void setSelectedItem( int item_id, const fb_pixel_t& sel_frame_col = COL_MENUCONTENTSELECTED_PLUS_0, - const fb_pixel_t& frame_col = COL_SHADOW_PLUS_0, + const fb_pixel_t& frame_col = COL_FRAME_PLUS_0, const fb_pixel_t& sel_body_col = COL_MENUCONTENT_PLUS_0, const fb_pixel_t& body_col = COL_MENUCONTENT_PLUS_0, const int& frame_w = 3, @@ -165,7 +165,7 @@ class CComponentsForm : public CComponentsItem ///select a definied item, parameter1 as CComponentsItem* virtual void setSelectedItem( CComponentsItem* cc_item, const fb_pixel_t& sel_frame_col = COL_MENUCONTENTSELECTED_PLUS_0, - const fb_pixel_t& frame_col = COL_SHADOW_PLUS_0, + const fb_pixel_t& frame_col = COL_FRAME_PLUS_0, const fb_pixel_t& sel_body_col = COL_MENUCONTENT_PLUS_0, const fb_pixel_t& body_col = COL_MENUCONTENT_PLUS_0, const int& frame_w = 3, diff --git a/src/gui/components/cc_frm_button.cpp b/src/gui/components/cc_frm_button.cpp index b7e964356..c0c0039b0 100644 --- a/src/gui/components/cc_frm_button.cpp +++ b/src/gui/components/cc_frm_button.cpp @@ -106,13 +106,13 @@ void CComponentsButton::initVarButton( const int& x_pos, const int& y_pos, const cc_body_gradient_enable = CC_COLGRAD_OFF/*g_settings.gradiant*/; //TODO: gradient is prepared for use but disabled at the moment till some other parts of gui parts are provide gradient setColBodyGradient(cc_body_gradient_enable/*CColorGradient::gradientLight2Dark*/, CFrameBuffer::gradientVertical, CColorGradient::light); col_frame = color_frame; - col_body = cc_body_gradient_enable? COL_DARK_GRAY : color_body; + col_body = col_body_old = cc_body_gradient_enable? COL_DARK_GRAY : color_body; col_shadow = color_shadow; cc_item_enabled = enabled; cc_item_selected = selected; fr_thickness = 0; //TODO: parts of the GUI still don't use framed buttons - append_x_offset = 6; + append_x_offset = OFFSET_INTER; append_y_offset = 0; corner_rad = RADIUS_SMALL; @@ -187,6 +187,7 @@ void CComponentsButton::initCaption() } //set basic properties + int x_offset = (!cc_btn_text_obj || !cc_btn_icon_obj) ? 0 : append_x_offset; int w_frame = fr_thickness; int reduce = 2*w_frame; if (cc_btn_text_obj){ @@ -198,7 +199,7 @@ void CComponentsButton::initCaption() if (cc_btn_font == NULL) cc_btn_font = g_Font[SNeutrinoSettings::FONT_TYPE_BUTTON_TEXT]; - int w_cap = min(width - append_x_offset - x_cap - reduce, cc_btn_font->getRenderWidth(cc_btn_text)); + int w_cap = min(width - x_offset - x_cap - reduce, cc_btn_font->getRenderWidth(cc_btn_text)); int h_cap = min(height - reduce, cc_btn_font->getHeight()); /*NOTE: paint of centered text in y direction without y_offset @@ -235,10 +236,10 @@ void CComponentsButton::initCaption() } //handle common position of icon and text inside container required for alignment - int w_required = w_frame + append_x_offset; - w_required += cc_btn_icon_obj ? cc_btn_icon_obj->getWidth() + append_x_offset : 0; + int w_required = w_frame + x_offset; + w_required += cc_btn_icon_obj ? cc_btn_icon_obj->getWidth() + x_offset : 0; w_required += cc_btn_font ? cc_btn_font->getRenderWidth(cc_btn_text) : 0; - w_required += append_x_offset + w_frame; + w_required += x_offset + w_frame; //dynamic width if (w_required > width){ @@ -247,10 +248,10 @@ void CComponentsButton::initCaption() } //do center - int x_icon = width/2 - w_required/2 /*+ fr_thickness + append_x_offset*/; + int x_icon = width/2 - w_required/2 /*+ fr_thickness + x_offset*/; int w_icon = 0; if (cc_btn_icon_obj){ - x_icon += w_frame + append_x_offset; + x_icon += w_frame + x_offset; cc_btn_icon_obj->setXPos(x_icon); w_icon = cc_btn_icon_obj->getWidth(); /*in case of dynamic changed height of caption or button opbject itself, @@ -260,7 +261,7 @@ void CComponentsButton::initCaption() cc_btn_icon_obj->setYPos(y_icon); } if (cc_btn_text_obj){ - cc_btn_text_obj->setXPos(x_icon + w_icon + append_x_offset); + cc_btn_text_obj->setXPos(x_icon + w_icon + x_offset); cc_btn_text_obj->setWidth(width - cc_btn_text_obj->getXPos()); } } diff --git a/src/gui/components/cc_frm_button.h b/src/gui/components/cc_frm_button.h index 1e36bd826..c85777ff7 100644 --- a/src/gui/components/cc_frm_button.h +++ b/src/gui/components/cc_frm_button.h @@ -103,7 +103,7 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); CComponentsButton( const int& x_pos, const int& y_pos, const int& w, const int& h, const neutrino_locale_t& caption_locale, @@ -112,7 +112,7 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); CComponentsButton( const int& x_pos, const int& y_pos, const int& w, const int& h, const neutrino_locale_t& caption_locale, @@ -121,7 +121,7 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); CComponentsButton( const int& x_pos, const int& y_pos, const int& w, const int& h, const std::string& caption, @@ -130,7 +130,7 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); ///set text color void setButtonTextColor(fb_pixel_t caption_color){cc_btn_text_col = caption_color;}; @@ -246,7 +246,7 @@ class CComponentsButtonRed : public CComponentsButton bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) :CComponentsButton(x_pos, y_pos, w, h, caption, NEUTRINO_ICON_BUTTON_RED, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow) { cc_item_type = CC_ITEMTYPE_BUTTON_RED; @@ -257,7 +257,7 @@ class CComponentsButtonRed : public CComponentsButton bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) :CComponentsButton(x_pos, y_pos, w, h, caption_locale, NEUTRINO_ICON_BUTTON_RED, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow) { cc_item_type = CC_ITEMTYPE_BUTTON_RED; @@ -277,7 +277,7 @@ class CComponentsButtonGreen : public CComponentsButton bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) :CComponentsButton(x_pos, y_pos, w, h, caption, NEUTRINO_ICON_BUTTON_GREEN, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow) { cc_item_type = CC_ITEMTYPE_BUTTON_GREEN; @@ -289,7 +289,7 @@ class CComponentsButtonGreen : public CComponentsButton bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) :CComponentsButton(x_pos, y_pos, w, h, caption_locale, NEUTRINO_ICON_BUTTON_GREEN, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow) { cc_item_type = CC_ITEMTYPE_BUTTON_GREEN; @@ -309,7 +309,7 @@ class CComponentsButtonYellow : public CComponentsButton bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) :CComponentsButton(x_pos, y_pos, w, h, caption, NEUTRINO_ICON_BUTTON_YELLOW, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow) { cc_item_type = CC_ITEMTYPE_BUTTON_YELLOW; @@ -320,7 +320,7 @@ class CComponentsButtonYellow : public CComponentsButton bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) :CComponentsButton(x_pos, y_pos, w, h, caption_locale, NEUTRINO_ICON_BUTTON_YELLOW, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow) { cc_item_type = CC_ITEMTYPE_BUTTON_YELLOW; @@ -340,7 +340,7 @@ class CComponentsButtonBlue : public CComponentsButton bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) :CComponentsButton(x_pos, y_pos, w, h, caption, NEUTRINO_ICON_BUTTON_BLUE, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow) { cc_item_type = CC_ITEMTYPE_BUTTON_BLUE; @@ -351,7 +351,7 @@ class CComponentsButtonBlue : public CComponentsButton bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) :CComponentsButton(x_pos, y_pos, w, h, caption_locale, NEUTRINO_ICON_BUTTON_BLUE, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow) { cc_item_type = CC_ITEMTYPE_BUTTON_BLUE; diff --git a/src/gui/components/cc_frm_clock.cpp b/src/gui/components/cc_frm_clock.cpp index 297406e9f..46d4781df 100644 --- a/src/gui/components/cc_frm_clock.cpp +++ b/src/gui/components/cc_frm_clock.cpp @@ -325,12 +325,14 @@ bool CComponentsFrmClock::startClock() if (cl_timer == NULL){ cl_timer = new CComponentsTimer(0); cl_timer->setThreadName("frmClock"); - if (cl_timer->OnTimer.empty()){ - dprintf(DEBUG_INFO,"\033[33m[CComponentsFrmClock]\t[%s] init slot...\033[0m\n", __func__); - cl_timer->OnTimer.connect(cl_sl_show); - force_paint_bg = true; - } } + + if (cl_timer->OnTimer.empty()){ + dprintf(DEBUG_INFO,"\033[33m[CComponentsFrmClock]\t[%s] init slot...\033[0m\n", __func__); + cl_timer->OnTimer.connect(cl_sl_show); + force_paint_bg = true; + } + cl_timer->setTimerInterval(cl_interval); if (cl_timer->startTimer()) @@ -390,7 +392,7 @@ void CComponentsFrmClock::paint(bool do_save_bg) void CComponentsFrmClock::setClockFont(Font *font, const int& style) { - if (cl_font != font || (cl_font != font)){ + if (cl_font != font || cl_font_style != style){ if (cl_font != font) cl_font = font; if (style != -1) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index 34d4fb226..75b14da0b 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -232,8 +232,10 @@ void CComponentsHeader::initIcon() //init cch_icon_obj only if an icon available if (cch_icon_name.empty()) { cch_icon_w = 0; - if (cch_icon_obj) + if (cch_icon_obj){ removeCCItem(cch_icon_obj); + cch_icon_obj = NULL; + } return; } diff --git a/src/gui/components/cc_item.h b/src/gui/components/cc_item.h index 37677a813..9d633ad62 100644 --- a/src/gui/components/cc_item.h +++ b/src/gui/components/cc_item.h @@ -110,7 +110,7 @@ class CComponentsItem : public CComponents ///set select mode virtual void setSelected(bool selected, const fb_pixel_t& sel_frame_col = COL_MENUCONTENTSELECTED_PLUS_0, - const fb_pixel_t& frame_col = COL_SHADOW_PLUS_0, + const fb_pixel_t& frame_col = COL_FRAME_PLUS_0, const fb_pixel_t& sel_body_col = COL_MENUCONTENT_PLUS_0, const fb_pixel_t& body_col = COL_MENUCONTENT_PLUS_0, const int& frame_w = 3, diff --git a/src/gui/components/cc_timer.cpp b/src/gui/components/cc_timer.cpp index ab6523840..d6659aa38 100644 --- a/src/gui/components/cc_timer.cpp +++ b/src/gui/components/cc_timer.cpp @@ -143,6 +143,7 @@ bool CComponentsTimer::startTimer() bool CComponentsTimer::stopTimer() { tm_enable = false; + OnTimer.clear(); stopThread(); if(tm_thread == 0) return true; diff --git a/src/gui/lua/lua_cc_text.cpp b/src/gui/lua/lua_cc_text.cpp index 461164e1a..2cbaa45d3 100644 --- a/src/gui/lua/lua_cc_text.cpp +++ b/src/gui/lua/lua_cc_text.cpp @@ -208,10 +208,11 @@ int CLuaInstCCText::CCTextSetText(lua_State *L) std::string text = ""; lua_Integer mode = D->mode; lua_Integer font_text = D->font_text; - tableLookup(L, "text", text); - tableLookup(L, "mode", mode); - tableLookup(L, "font_text", font_text); - + if (lua_istable(L, -1)){ + tableLookup(L, "text", text); + tableLookup(L, "mode", mode); + tableLookup(L, "font_text", font_text); + } D->ct->setText(text, mode, g_Font[font_text]); return 0; } diff --git a/src/gui/screensaver.cpp b/src/gui/screensaver.cpp index 3bf274b39..d3d61e7bb 100644 --- a/src/gui/screensaver.cpp +++ b/src/gui/screensaver.cpp @@ -164,7 +164,7 @@ void* CScreenSaver::ScreenSaverPrg(void* arg) if (g_settings.screensaver_timeout) { - while(1) + while(PScreenSaver) { PScreenSaver->paint(); sleep(g_settings.screensaver_timeout); diff --git a/src/gui/widget/buttons.cpp b/src/gui/widget/buttons.cpp index 9f483bd8c..18ad88a75 100644 --- a/src/gui/widget/buttons.cpp +++ b/src/gui/widget/buttons.cpp @@ -103,8 +103,8 @@ int paintButtons( const button_label_ext * const content, int w_footer = footerwidth; int h_footer = 0; - int w_space = 10; //minimal space between buttons - int h_space = 4; //minimal space between caption and/or icon and border + int w_space = OFFSET_INNER_MID; //minimal space between buttons + int h_space = OFFSET_INNER_SMALL; //minimal space between caption and/or icon and border int x_icon = x_footer + w_space; int x_caption = 0; @@ -312,8 +312,8 @@ int paintButtons( const int &x, int w_footer = footerwidth; int h_footer = 0; - int w_space = 10; //minimal space between buttons - int h_space = 4; //minimal space between caption and/or icon and border + int w_space = OFFSET_INNER_MID; //minimal space between buttons + int h_space = OFFSET_INNER_SMALL; //minimal space between caption and/or icon and border int x_icon = x_footer + w_space; int x_caption = 0; diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp index 45ef2b6ed..e0eec64f8 100644 --- a/src/gui/widget/hintbox.cpp +++ b/src/gui/widget/hintbox.cpp @@ -162,6 +162,8 @@ void CHintBox::init(const std::string& Text, const int& Width, const std::string if (!Text.empty()) addHintItem(Text, text_mode, Picon, COL_MENUCONTENT_TEXT, hb_font); + else + ReSize(); } CHintBox::~CHintBox() @@ -186,6 +188,7 @@ void CHintBox::enableTimeOutBar(bool enable) timeout_pb->setValues(timeout_pb->getValue()+1, 100*timeout); }else{ timeout_pb = new CProgressBar(); + timeout_pb->setType(CProgressBar::PB_TIMESCALE); timeout_pb->setDimensionsAll(ccw_body->getRealXPos(), ccw_body->getRealYPos(), ccw_body->getWidth(), TIMEOUT_BAR_HEIGHT); timeout_pb->setValues(0, 100*timeout); if (!timeout_pb_timer) { @@ -312,13 +315,8 @@ void CHintBox::addHintItem(const std::string& Text, const int& text_mode, const info_box->setPicture(Picon); info_box->doPaintBg(false); - /* recalculate new hintbox height */ + /* recalculate new hintbox dimensions and position*/ ReSize(); - - /* set hint box position general to center and refresh window */ - setCenterPos(CC_ALONG_X); - y = frameBuffer->getScreenY() + ((frameBuffer->getScreenHeight() - height) >> 2), - Refresh(); } void CHintBox::setMsgText(const std::string& Text, const uint& hint_id, const int& mode, Font* font_text, const fb_pixel_t& color_text, const int& style) @@ -350,6 +348,10 @@ void CHintBox::ReSize() h += item->getHeight(); } height = min(HINTBOX_MAX_HEIGHT, max(HINTBOX_MIN_HEIGHT, max(height,h))); + + /* set hint box position general to center and refresh window */ + setCenterPos(CC_ALONG_X); + y = frameBuffer->getScreenY() + ((frameBuffer->getScreenHeight() - height) >> 2), Refresh(); } diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index eb40539cb..c1cdbfe30 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -335,7 +335,7 @@ int CMsgBox::exec() void CMsgBox::refreshFoot(void) { - ccw_footer->paint(false); + ccw_footer->getButtonChainObject()->paint(); }