CComponentsHeader: optimize auto size mode for logos

With very large font size settings it is possible
that header is too large for reasonable display of logos, because of
possible bad upscale effects (eg. step effects).
So it seems it's better to use original size as largest possible size.


Origin commit data
------------------
Commit: 76cd93555d
Author: Thilo Graf <dbt@novatux.de>
Date: 2017-04-25 (Tue, 25 Apr 2017)
This commit is contained in:
2017-04-25 11:31:53 +02:00
parent beac8c69aa
commit 35f867b611
2 changed files with 9 additions and 0 deletions

View File

@@ -281,6 +281,14 @@ void CComponentsHeader::initLogo()
else else
cch_logo_obj->setChannel(cch_logo.Id, cch_logo.Name); cch_logo_obj->setChannel(cch_logo.Id, cch_logo.Name);
//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 ;
cch_logo_obj->getRealSize(&dx_orig, &dy_orig);
if (cch_logo.dy_max > dy_orig)
cch_logo.dy_max = dy_orig;
}
if (cch_logo_obj->hasLogo()){ if (cch_logo_obj->hasLogo()){
cch_logo_obj->setHeight(cch_logo.dy_max, true); cch_logo_obj->setHeight(cch_logo.dy_max, true);

View File

@@ -319,6 +319,7 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen
* CC_LOGO_RIGHT \n * CC_LOGO_RIGHT \n
* @param[in] dy * @param[in] dy
* @li optional logo height, default = -1 (auto) * @li optional logo height, default = -1 (auto)
* @note In auto mode, logo use full height minus inner offset but not larger than original logo height.
*/ */
void setChannelLogo( const uint64_t& channelId, void setChannelLogo( const uint64_t& channelId,
const std::string& channelName, const std::string& channelName,