Skip to content

Commit

Permalink
Merge pull request #1437 from golamrabbiazad/master
Browse files Browse the repository at this point in the history
fix: pinned task position captured
  • Loading branch information
alainm23 authored Sep 16, 2024
2 parents 1febec3 + 1205a75 commit eac1516
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 eac1516

Please sign in to comment.