~aleteoryx/muditaos

a89d700cdc25a3931348eb41b4a5649ba3d8e5c1 — Mateusz Piesta 3 years ago 228fca4
[BH-1520] Missing bottom texts

Controlling each list item's bottom
text by setVisibility does not give correct
results. It is required to explicitly resize
the bottom container.

From now on, resize call is
placed in ListItemBase so each new and existing
list items will be affected by this change resulting
in proper behavior without need for the programmer to
remember about it.
M products/BellHybrid/apps/common/include/common/widgets/list_items/NumberWithSuffix.hpp => products/BellHybrid/apps/common/include/common/widgets/list_items/NumberWithSuffix.hpp +1 -2
@@ 1,4 1,4 @@
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once


@@ 40,7 40,6 @@ namespace app::list_items
        void control_bottom_description(const spinner_type::value_type &value) final
        {
            bottomText->setVisible(value != 0);
            body->resize();
        }
    };
} // namespace app::list_items

M products/BellHybrid/apps/common/include/common/widgets/list_items/details.hpp => products/BellHybrid/apps/common/include/common/widgets/list_items/details.hpp +2 -1
@@ 1,4 1,4 @@
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once


@@ 98,6 98,7 @@ namespace app::list_items
                body->setMinMaxArrowsVisibility(spinner->is_min(), spinner->is_max());
                if (not this->bottomDescription.empty()) {
                    control_bottom_description(spinner->value());
                    body->resize();
                }
            }
            SpinnerType *spinner{};