mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 00:11:14 +02:00
CComponentsHeader: optimize logo size/position handling
Prevent oversized paint with stupid screen and/or font size settings
This commit is contained in:
@@ -277,10 +277,13 @@ void CComponentsHeader::initLogo()
|
||||
int h_logo = cch_logo.dy_max == -1 ? height - 2*OFFSET_INNER_MIN : cch_logo.dy_max;
|
||||
|
||||
if(!cch_logo_obj)
|
||||
cch_logo_obj = new CComponentsChannelLogoScalable(width/2, height/2 - h_logo/2, cch_logo.Name, cch_logo.Id, this);
|
||||
cch_logo_obj = new CComponentsChannelLogoScalable(1, height/2 - h_logo/2, cch_logo.Name, cch_logo.Id, this);
|
||||
else
|
||||
cch_logo_obj->setChannel(cch_logo.Id, cch_logo.Name);
|
||||
|
||||
// use value 1 as initial value for logo width, ensures downscale with stupid available logo space
|
||||
cch_logo_obj->setHeight(1, true);
|
||||
|
||||
//ensure logo is not larger than original size if in auto mode
|
||||
if (cch_logo.dy_max == -1){
|
||||
int dx_orig = 0, dy_orig = 0 ;
|
||||
@@ -289,6 +292,7 @@ void CComponentsHeader::initLogo()
|
||||
h_logo = dy_orig;
|
||||
}
|
||||
|
||||
//cch_logo_obj->setWidth(1, true);
|
||||
if (cch_logo_obj->hasLogo()){
|
||||
cch_logo_obj->setHeight(h_logo, true);
|
||||
|
||||
@@ -533,7 +537,7 @@ void CComponentsHeader::initCaption()
|
||||
cch_btn_obj->setXPos(width - buttons_w);
|
||||
|
||||
//set required width of caption object
|
||||
cc_text_w -= (buttons_w + cch_offset);
|
||||
cc_text_w -= buttons_w;
|
||||
}
|
||||
|
||||
//clock
|
||||
@@ -548,7 +552,7 @@ void CComponentsHeader::initCaption()
|
||||
cch_cl_obj->setXPos(width - buttons_w - clock_w);
|
||||
|
||||
//set required width of caption object
|
||||
cc_text_w -= (clock_w + cch_offset);
|
||||
cc_text_w -= clock_w;
|
||||
|
||||
//stop clock if disabled or option run is disabled and clock is running
|
||||
if (cch_cl_enable){
|
||||
|
Reference in New Issue
Block a user