Clone in a terminal:
Commit 8cfa6f3
Johan Mattsson - 2015-11-06T18:29:54+00:00
8cfa6f3c59bd2ca569d9581fedb1bbefd1de6ab6johan.mattsson.m@gmail.com

Update image selection when background tab is selected

Changed files (1)

Diff

diff --git a/libbirdfont/BackgroundTools.vala b/libbirdfont/BackgroundTools.valaindex 5bf630c..a95cd85 100644--- a/libbirdfont/BackgroundTools.vala+++ b/libbirdfont/BackgroundTools.vala@@ -69,9 +69,26 @@ public class BackgroundTools : ToolCollection  { 		MainWindow.get_tab_bar ().select_tab_name ("Backgrounds"); 	} +	public override void selected () {+		// perform update after label selection is done+		IdleSource idle = new IdleSource (); +		idle.set_callback (() => {+			foreach (Tool t in files.tool) {+				BackgroundSelectionLabel bg = (BackgroundSelectionLabel) t;+				+				if (bg.is_selected ()) {+					update_parts_list (bg.img);+				}+			}+				+			return false;+		});+		idle.attach (null);+	}+ 	public void update_parts_list (BackgroundImage current_image) { 		parts.tool.clear ();-		+ 		foreach (BackgroundSelection selection in current_image.selections) { 			add_part (selection); 		}@@ -240,6 +257,8 @@ public class BackgroundTools : ToolCollection  { 			set_default_canvas (); 		}); 		+		image_selection.select_action ((BackgroundSelectionLabel) image_selection);+		 		image_selection.delete_action.connect ((t) => { 			// don't invalidate the toolbox iterator 			IdleSource idle = new IdleSource (); 

Contact

Email: johan.mattsson.m@gmail.com
Mastodon: typo.social/@birdfont
GitHub: johanmattssonm
LinkedIn: johan-mattsson-2ab324112