The Birdfont Source Code


All Repositories / birdfont.git / commitdiff – RSS feed

Update image selection when background tab is selected

These changes was commited to the Birdfont repository Fri, 06 Nov 2015 18:29:54 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
[Fri, 06 Nov 2015 18:29:54 +0000]

Updated Files

libbirdfont/BackgroundTools.vala
--- a/libbirdfont/BackgroundTools.vala +++ b/libbirdfont/BackgroundTools.vala @@ -67,11 +67,28 @@ void set_default_canvas () { 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); } @@ -239,6 +256,8 @@ set_default_canvas (); }); + + image_selection.select_action ((BackgroundSelectionLabel) image_selection); image_selection.delete_action.connect ((t) => { // don't invalidate the toolbox iterator