~aleteoryx/muditaos

a07177c3904a5da25df5e4183f79ba10be4a27f4 — Lefucjusz 2 years ago 196ee43
[MOS-932] Fix unneeded deep refresh in empty list

Fix of the issue that pressing up arrow in
empty list (e.g. notes, messages, alarms)
resulted in unnecessary deep refresh of
the screen, as the content didn't change.
M module-gui/gui/widgets/ListViewEngine.cpp => module-gui/gui/widgets/ListViewEngine.cpp +2 -2
@@ 1,4 1,4 @@
// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "ListViewEngine.hpp"


@@ 20,7 20,7 @@ namespace gui

    void ListViewEngine::setElementsCount(unsigned int count)
    {
        if (elementsCount != count || elementsCount == 0) {
        if ((elementsCount != count) || (elementsCount == listview::nPos)) {
            onElementsCountChanged(count);
        }
    }

M module-gui/gui/widgets/ListViewEngine.hpp => module-gui/gui/widgets/ListViewEngine.hpp +2 -2
@@ 1,4 1,4 @@
// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once


@@ 109,7 109,7 @@ namespace gui
        [[nodiscard]] unsigned int getFocusItemIndex();

        /// Total provider elements count
        unsigned int elementsCount = 0;
        unsigned int elementsCount = listview::nPos;
        void setElementsCount(unsigned int count);
        void onElementsCountChanged(unsigned int count);
        bool shouldCallEmptyListCallbacks = false;

M pure_changelog.md => pure_changelog.md +1 -0
@@ 70,6 70,7 @@
* Fixed broken abbreviating of multiline text messages content in deletion window
* Fixed misleading labels in the Phonebook application when using search engine
* Fixed text pasting in new contact window when some text is already present there
* Fixed unnecessary deep refresh when pressing up arrow in empty list view

## [1.6.0 2023-02-27]