From c2a3298b5b19f84efa118a60d9b8a706928e4f28 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Mon, 31 May 2021 22:07:16 +0300 Subject: [PATCH] abilityitem:fix bindingloop headIsVisibleSeparator --- .../abilities/items/basicitem/HiddenSpacer.qml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/declarativeimports/abilities/items/basicitem/HiddenSpacer.qml b/declarativeimports/abilities/items/basicitem/HiddenSpacer.qml index 11f807847..e3304ade6 100644 --- a/declarativeimports/abilities/items/basicitem/HiddenSpacer.qml +++ b/declarativeimports/abilities/items/basicitem/HiddenSpacer.qml @@ -33,6 +33,7 @@ Item{ Binding{ target: hiddenSpacer property: "nHiddenSize" + when: !hiddenSizeDelayer.running && itemIndex > -1 //! helps to solve BUGLOCALREF: #1 value: { if (abilityItem.isHidden) { return 0; @@ -79,4 +80,21 @@ Item{ color: "transparent" } } + + //! Delayer + onSeparatorSpaceChanged: { + if (!hiddenSizeDelayer.running) { + hiddenSizeDelayer.start(); + } + } + + //! BUGLOCALREF: #1 + //! Timer that helps to avoid binding loops from head/tailItemIsVisibleSeparator by delaying to update the spacer size + //! This solution needs confirmation. That specific binding loop is very nasty as it breaks the tasks model consistency + //! somehow when switching between different activities and the model contains separators that become shown and hidden + //! during the activity change + Timer { + id: hiddenSizeDelayer + interval: 400 + } }