Commit 8464835
Fix background tools selection
Changed files (3)
modifiedlibbirdfont/BackgroundImage.valamodifiedlibbirdfont/BackgroundTools.valamodifiedlibbirdfont/DrawingTools.vala
Diff
@@ -366,7 +366,6 @@ public class BackgroundImage { if (get_img_rotation_from_coordinate (x, y, out rotation)) { img_rotation = rotation; backgounds = get_image ();- double view_zoom = MainWindow.get_current_glyph ().view_zoom; ImageSurface rotated; img_rotation = rotation;@@ -40,17 +40,22 @@ public class BackgroundTools : ToolCollection { parts.set_unique (true); background_tools.add_tool (select_background);+ select_background.select_action.connect (update_tool_selection); ++ background_tools.add_tool (DrawingTools.move_background);+ DrawingTools.move_background.select_action.connect (update_tool_selection); + + background_tools.add_tool (DrawingTools.move_canvas);+ DrawingTools.move_canvas.select_action.connect (update_tool_selection); + background_tools.add_tool (DrawingTools.background_scale);+ LabelTool add_new_image = new LabelTool (t_("Add")); add_new_image.select_action.connect ((t) => { load_image (); }); background_selection.add_tool (add_new_image);-- background_tools.add_tool (DrawingTools.move_background);- background_tools.add_tool (DrawingTools.move_canvas);- background_tools.add_tool (DrawingTools.background_scale);-+ expanders.add (font_name); expanders.add (background_tools); expanders.add (DrawingTools.zoombar_tool);@@ -60,6 +65,14 @@ public class BackgroundTools : ToolCollection { expanders.add (parts); } + public void update_tool_selection (Tool selected) {+ select_background.set_selected (false);+ DrawingTools.move_background.set_selected (false);+ DrawingTools.move_canvas.set_selected (false);+ DrawingTools.background_scale.set_selected (false);+ selected.set_selected (true);+ }+ public void remove_images () { files.tool.clear (); parts.tool.clear ();@@ -1377,14 +1377,19 @@ public class DrawingTools : ToolCollection { idle.set_callback (() => { Glyph g = MainWindow.get_current_glyph (); - hide_all_modifiers ();- foreach (Tool t in draw_tools.tool) { if (t != current_tool) { t.set_selected (false); } } + FontDisplay display = MainWindow.get_current_display ();+ + if (display.get_name () == "Backgrounds") {+ return false;+ }++ hide_all_modifiers (); cut_background.set_selected (false); bezier_tool.set_selected (false);