Skip to content

Commit

Permalink
fix: pinned task position captured
Browse files Browse the repository at this point in the history
  • Loading branch information
golamrabbiazad committed Sep 15, 2024
1 parent a374e5d commit 929e0f3
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions src/Widgets/PinnedItemsFlowBox.vala
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,11 @@ public class Widgets.PinnedItemsFlowBox : Adw.Bin {
});

project.item_deleted.connect ((item) => {
if (!items_map.has_key (item.id)) {
return;
}
update_pinboard(item);
});

items_map[item.id].hide_widget ();
box_layout.remove (items_map[item.id]);
items_map.unset (item.id);

check_reveal_child ();
Services.EventBus.get_default ().item_moved.connect ((item) => {
update_pinboard(item);
});

Services.Store.instance ().item_pin_change.connect ((item) => {
Expand Down Expand Up @@ -137,7 +133,19 @@ public class Widgets.PinnedItemsFlowBox : Adw.Bin {
}
}

private void update_pinboard(Objects.Item item) {
if (!items_map.has_key (item.id)) {
return;
}

items_map[item.id].hide_widget ();
box_layout.remove (items_map[item.id]);
items_map.unset (item.id);

check_reveal_child ();
}

private void check_reveal_child () {
main_revealer.reveal_child = items_map.size > 0;
}
}
}

0 comments on commit 929e0f3

Please sign in to comment.