From 929e0f3decb41687329c83c3719f3382a788ea4c Mon Sep 17 00:00:00 2001 From: Golamrabbi Azad Date: Sun, 15 Sep 2024 19:35:34 +0600 Subject: [PATCH 1/2] fix: pinned task position captured --- src/Widgets/PinnedItemsFlowBox.vala | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/Widgets/PinnedItemsFlowBox.vala b/src/Widgets/PinnedItemsFlowBox.vala index 5a870ad28..1d2f07e0f 100644 --- a/src/Widgets/PinnedItemsFlowBox.vala +++ b/src/Widgets/PinnedItemsFlowBox.vala @@ -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) => { @@ -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; } -} \ No newline at end of file +} From 1205a7524aa555ca0d8ead5ba583da35bc506e28 Mon Sep 17 00:00:00 2001 From: Golamrabbi Azad Date: Sun, 15 Sep 2024 19:46:42 +0600 Subject: [PATCH 2/2] fix: space-before-param lint error --- src/Widgets/PinnedItemsFlowBox.vala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Widgets/PinnedItemsFlowBox.vala b/src/Widgets/PinnedItemsFlowBox.vala index 1d2f07e0f..cba11f43f 100644 --- a/src/Widgets/PinnedItemsFlowBox.vala +++ b/src/Widgets/PinnedItemsFlowBox.vala @@ -66,11 +66,11 @@ public class Widgets.PinnedItemsFlowBox : Adw.Bin { }); project.item_deleted.connect ((item) => { - update_pinboard(item); + update_pinboard (item); }); Services.EventBus.get_default ().item_moved.connect ((item) => { - update_pinboard(item); + update_pinboard (item); }); Services.Store.instance ().item_pin_change.connect ((item) => { @@ -133,7 +133,7 @@ public class Widgets.PinnedItemsFlowBox : Adw.Bin { } } - private void update_pinboard(Objects.Item item) { + private void update_pinboard (Objects.Item item) { if (!items_map.has_key (item.id)) { return; }