From 8d9742e1bfc948ff346d7dc57c4562c5048a4b26 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 26 Apr 2017 07:51:38 +0200 Subject: [PATCH] CComponentsHeader: fix logo position with clock This reverts "fix logo position with clock", commit 28c88cd6f266f1951b44f54c602a11e8c35fb088. Was not the right way. Id's are not in visual order, therefore it's better to calculate direct with the ''width"" properties of possible following items clock and context buttons. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c2bc8b4f8f3ea150e4052a12856f5296c476485c Author: Thilo Graf Date: 2017-04-26 (Wed, 26 Apr 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_header.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index 2c1d45f14..f4f013203 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -294,12 +294,15 @@ void CComponentsHeader::initLogo() // set id of logo item depends of neighbor items int logo_id = getCCItemId(cch_logo_obj); - int next_id = logo_id + 1; int prev_id = logo_id - 1; //right end - int x_logo_right = getCCItem(next_id) ? getCCItem(next_id)->getXPos() - cch_logo_obj->getWidth() : width - cch_logo_obj->getWidth()-OFFSET_INNER_MID; - x_logo_right -= cch_cl_enable ? cch_cl_obj->getWidth() : 0; + int x_logo_right = width - cch_logo_obj->getWidth(); + if (cch_btn_obj) + x_logo_right -= cch_btn_obj->getWidth(); + if (cch_cl_obj) + x_logo_right -= cch_cl_obj->getWidth(); + //left end int x_logo_left = getCCItem(prev_id) ? getCCItem(prev_id)->getXPos() + getCCItem(prev_id)->getWidth() : 0;