From 7a43f3a40a76226a1f4cbe7134a358395438aac0 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 11 Jun 2022 13:48:10 +0200 Subject: [PATCH] cc_frm_header: try to fix next_item detection Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2dd517df08d13b4085d3c6333cdf7dd3c0e3e694 Author: vanhofen Date: 2022-06-11 (Sat, 11 Jun 2022) Origin message was: ------------------ - cc_frm_header: try to fix next_item detection --- src/gui/components/cc_frm_header.cpp | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index 5ecb47124..043d453af 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -323,20 +323,12 @@ void CComponentsHeader::initLogo() */ 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) - next_item = cch_pb_obj; - else if (cch_cl_obj) - next_item = cch_cl_obj; - else - next_item = cch_btn_obj; - } + if (cch_pb_obj) + next_item = cch_pb_obj; + else if (cch_cl_obj) + next_item = cch_cl_obj; + else + next_item = cch_btn_obj; } /* @@ -383,8 +375,10 @@ void CComponentsHeader::initLogo() if (cch_caption_align & CC_TITLE_RIGHT) { if (next_item) + { if (x_logo + w_logo >= next_item->getXPos()) x_logo = next_item->getXPos() - logo_space/2 - w_logo/2; + } } }