From a07177c3904a5da25df5e4183f79ba10be4a27f4 Mon Sep 17 00:00:00 2001 From: Lefucjusz Date: Mon, 6 Mar 2023 18:39:59 +0100 Subject: [PATCH] [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. --- module-gui/gui/widgets/ListViewEngine.cpp | 4 ++-- module-gui/gui/widgets/ListViewEngine.hpp | 4 ++-- pure_changelog.md | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/module-gui/gui/widgets/ListViewEngine.cpp b/module-gui/gui/widgets/ListViewEngine.cpp index f7141abe9caec06f88eb29fbcebe499890b6b2e0..c4a8745738bcadb68bd77b3ffe3bd433e5475bb5 100644 --- a/module-gui/gui/widgets/ListViewEngine.cpp +++ b/module-gui/gui/widgets/ListViewEngine.cpp @@ -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); } } diff --git a/module-gui/gui/widgets/ListViewEngine.hpp b/module-gui/gui/widgets/ListViewEngine.hpp index 2611a3b48e3d6ee15b314ceadcab80b43ea80d0d..c035e582a805a8499b9550974a05891e4a49b925 100644 --- a/module-gui/gui/widgets/ListViewEngine.hpp +++ b/module-gui/gui/widgets/ListViewEngine.hpp @@ -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; diff --git a/pure_changelog.md b/pure_changelog.md index ddc953b0e75cac7dfe9b037c53ba35976c96bb2e..dd28930fab243bc7e08ae85ab24843f9da57e4d5 100644 --- a/pure_changelog.md +++ b/pure_changelog.md @@ -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]