- cc_frm_header: try to fix next_item detection

Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
svenhoefer
2022-06-11 13:48:10 +02:00
committed by Thilo Graf
parent 1beebda581
commit 23e01f43d7

View File

@@ -323,13 +323,6 @@ void CComponentsHeader::initLogo()
*/ */
if (next_item) if (next_item)
{ {
if (next_item->getItemType() == CC_ITEMTYPE_FRM_CLOCK)
{
/*
* Either clock is present or buttons are enabled,
* different order of objects are required, not optimal
* but works at the moment.
*/
if (cch_pb_obj) if (cch_pb_obj)
next_item = cch_pb_obj; next_item = cch_pb_obj;
else if (cch_cl_obj) else if (cch_cl_obj)
@@ -337,7 +330,6 @@ void CComponentsHeader::initLogo()
else else
next_item = cch_btn_obj; next_item = cch_btn_obj;
} }
}
/* /*
* Adjust usable space for logo. * Adjust usable space for logo.
@@ -383,10 +375,12 @@ void CComponentsHeader::initLogo()
if (cch_caption_align & CC_TITLE_RIGHT) if (cch_caption_align & CC_TITLE_RIGHT)
{ {
if (next_item) if (next_item)
{
if (x_logo + w_logo >= next_item->getXPos()) if (x_logo + w_logo >= next_item->getXPos())
x_logo = next_item->getXPos() - logo_space/2 - w_logo/2; x_logo = next_item->getXPos() - logo_space/2 - w_logo/2;
} }
} }
}
/* /*
* Finally set logo x position * Finally set logo x position