diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index f4a0dbf7f..6851536d7 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -1699,13 +1699,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 @@ -2176,16 +2178,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_button.cpp b/src/gui/components/cc_frm_button.cpp index c7215b4fc..c0c0039b0 100644 --- a/src/gui/components/cc_frm_button.cpp +++ b/src/gui/components/cc_frm_button.cpp @@ -112,7 +112,7 @@ void CComponentsButton::initVarButton( const int& x_pos, const int& y_pos, const 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_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 f0a5ba052..bce82f375 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_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;