cc_frm_footer: ensure unsigned value for w_btn_tmp

Origin commit data
------------------
Commit: b337083558
Author: Thilo Graf <dbt@novatux.de>
Date: 2020-01-05 (Sun, 05 Jan 2020)
This commit is contained in:
2020-01-05 22:22:22 +01:00
committed by vanhofen
parent b375191aa0
commit f45ecde1c0

View File

@@ -279,6 +279,7 @@ void CComponentsFooter::setButtonLabels(const struct button_label_cc * const con
//w_btn_tmp = w_btn; //w_btn_tmp = w_btn;
for (i = 0; i < c_btns; i++){ for (i = 0; i < c_btns; i++){
w_btn_tmp -= c_btns; w_btn_tmp -= c_btns;
w_btn_tmp = max(0, w_btn_tmp);
btn_container->getCCItem(i)->setWidth(w_btn_tmp); // value = 0 forces recalculation, refresh is required btn_container->getCCItem(i)->setWidth(w_btn_tmp); // value = 0 forces recalculation, refresh is required
static_cast<CComponentsButton*>(btn_container->getCCItem(i))->Refresh(); static_cast<CComponentsButton*>(btn_container->getCCItem(i))->Refresh();
w_used_tmp -= max(0, btn_container->getCCItem(i)->getWidth()); w_used_tmp -= max(0, btn_container->getCCItem(i)->getWidth());