1
0
mirror of https://github.com/KDE/latte-dock.git synced 2024-12-23 01:33:50 +03:00

abilityitem:fix bindingloop headIsVisibleSeparator

This commit is contained in:
Michail Vourlakos 2021-05-31 22:07:16 +03:00
parent e85c3229ca
commit c2a3298b5b

View File

@ -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
}
}