Commit 4a03e1e
Add glyphs from overivew to spacing class
Changed files (5)
modifiedlibbirdfont/AbstractMenu.valamodifiedlibbirdfont/GlyphSelection.valamodifiedlibbirdfont/SpacingClassTab.valamodifiedlibbirdfont/SpacingClassTools.valamodifiedlibbirdfont/Toolbox.vala
Diff
@@ -231,6 +231,7 @@ public class AbstractMenu : GLib.Object { public void add_tool_key_bindings () { ToolItem tool_item;+ foreach (ToolCollection tool_set in MainWindow.get_toolbox ().tool_sets) { foreach (Expander e in tool_set.get_expanders ()) { foreach (Tool t in e.tool) {@@ -27,7 +27,9 @@ public class GlyphSelection : OverView { FontDisplay.dirty_scrollbar = true; open_glyph_signal.connect ((gc) => {- selected_glyph (gc);+ print(@"name $(gc.get_name ())\n");+ print(@"g name $(gc.get_current ().get_name ())\n");+ selected_glyph (gc); Toolbox.redraw_tool_box (); }); @@ -30,6 +30,17 @@ public class SpacingClassTab : Table { public override Gee.ArrayList<Row> get_rows () { return rows; }+ + public static void set_class (string glyph) {+ print(@"G: $(glyph)\n");+ if (current_class_first_element) {+ current_class.first = glyph;+ } else {+ current_class.next = glyph;+ }+ + MainWindow.get_spacing_class_tab ().update_rows ();+ } public override void selected_row (Row row, int column, bool delete_button) { Font font = BirdFont.get_current_font ();@@ -56,11 +67,13 @@ public class SpacingClassTab : Table { } current_class = spacing.classes.get (row.get_index ()); current_class.set_first ();+ current_class_first_element = true; font.touch (); } else if (column == 2) { return_if_fail (0 <= row.get_index () < spacing.classes.size); current_class = spacing.classes.get (row.get_index ());- current_class .set_next ();+ current_class.set_next ();+ current_class_first_element = false; font.touch (); } }@@ -21,6 +21,11 @@ public class SpacingClassTools : ToolCollection { public static Gee.ArrayList<Expander> expanders; public SpacingClassTools () {+ expanders = new Gee.ArrayList<Expander> ();++ Expander font_name = new Expander ();+ font_name.add_tool (new FontName ());+ Expander spacing_class_tools = new Expander (); Tool insert = new Tool ("insert_glyph_from_overview_in_spacing_class", t_("Insert glyph from overview")); @@ -30,15 +35,20 @@ public class SpacingClassTools : ToolCollection { GlyphSelection glyph_selection = new GlyphSelection (); glyph_selection.selected_glyph.connect ((glyph_collection) => {- SpacingClassTab.current_class.update_class (glyph_collection.get_name (),- SpacingClassTab.current_class_first_element);+ print (@"glyph_collection.get_name (): $(glyph_collection.get_name ())\n");+ SpacingClassTab.set_class (glyph_collection.get_name ()); MainWindow.get_tab_bar ().select_tab_name ("SpacingClasses"); }); GlyphCanvas.set_display (glyph_selection); self.set_selected (false);+ + TabContent.hide_text_input (); }); spacing_class_tools.add_tool (insert);+ + expanders.add (font_name);+ expanders.add (spacing_class_tools); } public override Gee.ArrayList<Expander> get_expanders () {@@ -126,6 +126,8 @@ public class Toolbox : GLib.Object { current_set = (ToolCollection) overview_tools; } else if (tab_name == "Backgrounds") { current_set = (ToolCollection) background_tools;+ } else if (tab_name == "SpacingClasses") {+ current_set = (ToolCollection) spacing_class_tools; } else if (tab_name == "Themes") { current_set = (ToolCollection) theme_tools; } else if (t != null && ((!) t).get_display () is GlyphTab) {