Commit c318219
Install default key bindings
Changed files (11)
deletedicons/new_grid.pngaddedicons/show_grid.pngmodifiedinstall.pymodifiedlibbirdfont/DrawingTools.valamodifiedlibbirdfont/ForesightTool.valamodifiedlibbirdfont/GridTool.valamodifiedlibbirdfont/KerningTools.valamodifiedlibbirdfont/Menu.valamodifiedlibbirdfont/MoveTool.valamodifiedlibbirdfont/PointTool.valaaddedresources/key_bindings.xml
Diff
deleted file mode 100644Binary files a/icons/new_grid.png and /dev/null differnew file mode 100644Binary files /dev/null and b/icons/show_grid.png differ@@ -87,6 +87,8 @@ for file in os.listdir('./layout'): for file in os.listdir('./icons'): install ('icons/' + file, '/share/birdfont/icons', 644) +install ('resources/key_bindings.xml', '/share/birdfont', 644)+ install ('resources/linux/birdfont.desktop', '/share/applications', 644) install ('resources/linux/128x128/birdfont.png', '/share/icons/hicolor/128x128/apps', 644) install ('resources/linux/48x48/birdfont.png', '/share/icons/hicolor/48x48/apps', 644)@@ -164,7 +164,7 @@ public class DrawingTools : ToolCollection { }); draw_tools.add_tool (move_background); - move_canvas = new Tool ("move_canvas", t_("Move canvas"), 'h');+ move_canvas = new Tool ("move_canvas", t_("Move canvas")); move_canvas.select_action.connect ((self) => { update_drawing_and_background_tools (self); }); @@ -505,7 +505,7 @@ public class DrawingTools : ToolCollection { } // tie edit point handles- tie_handles = new Tool ("tie_point", t_("Tie curve handles for the selected edit point"), 'w');+ tie_handles = new Tool ("tie_point", t_("Tie curve handles for the selected edit point")); tie_handles.select_action.connect ((self) => { bool tie; EditPoint p;@@ -541,7 +541,7 @@ public class DrawingTools : ToolCollection { draw_tool_modifiers.add_tool (tie_handles); // symmetrical handles- reflect_handle = new Tool ("symmetric", t_("Symmetrical handles"), 'r');+ reflect_handle = new Tool ("symmetric", t_("Symmetrical handles")); reflect_handle.select_action.connect ((self) => { bool symmetrical; PointSelection ep;@@ -563,7 +563,7 @@ public class DrawingTools : ToolCollection { }); draw_tool_modifiers.add_tool (reflect_handle); - create_line = new Tool ("create_line", t_("Convert segment to line."), 'r');+ create_line = new Tool ("create_line", t_("Convert segment to line.")); create_line.select_action.connect ((self) => { PenTool.convert_segment_to_line (); MainWindow.get_current_glyph ().update_view ();@@ -582,7 +582,7 @@ public class DrawingTools : ToolCollection { }); draw_tool_modifiers.add_tool (reverse_path_tool); - move_layer = new Tool ("move_layer", t_("Move to path to the bottom layer"), 'd');+ move_layer = new Tool ("move_layer", t_("Move to path to the bottom layer")); move_layer.select_action.connect ((self) => { Glyph g = MainWindow.get_current_glyph (); @@ -797,7 +797,7 @@ public class DrawingTools : ToolCollection { } // guide lines, grid and other guidlines- help_lines = new Tool ("help_lines", t_("Show guidelines"), 'l');+ help_lines = new Tool ("help_lines", t_("Show guidelines")); help_lines.select_action.connect ((self) => { bool h; h = GlyphCanvas.get_current_glyph ().get_show_help_lines ();@@ -808,7 +808,7 @@ public class DrawingTools : ToolCollection { guideline_tools.add_tool (help_lines); - xheight_help_lines = new Tool ("show_xheight_helplines", t_("Show guidelines for x-height and baseline"), 'x');+ xheight_help_lines = new Tool ("show_xheight_helplines", t_("Show guidelines for x-height and baseline")); xheight_help_lines.select_action.connect ((self) => { Glyph g = MainWindow.get_current_glyph (); bool v = !g.get_xheight_lines_visible ();@@ -822,7 +822,7 @@ public class DrawingTools : ToolCollection { }); guideline_tools.add_tool (xheight_help_lines); - background_help_lines = new Tool ("background_help_lines", t_("Show guidelines at top and bottom margin"), 't');+ background_help_lines = new Tool ("background_help_lines", t_("Show guidelines at top and bottom margin")); background_help_lines.select_action.connect ((self) => { Glyph g = MainWindow.get_current_glyph (); bool v = !g.get_margin_lines_visible ();@@ -836,7 +836,7 @@ public class DrawingTools : ToolCollection { }); guideline_tools.add_tool (background_help_lines); - Tool new_grid = new GridTool ("new_grid");+ Tool new_grid = new GridTool ("show_grid"); guideline_tools.add_tool (new_grid); // Zoom tools @@ -861,7 +861,7 @@ public class DrawingTools : ToolCollection { }); zoombar_tool.add_tool (zoom_bar); - Tool zoom_in = new Tool ("zoom_in", "", '+', CTRL);+ Tool zoom_in = new Tool ("zoom_in", "Zoom In"); zoom_in.select_action.connect ((self) => { zoom_tool.store_current_view (); glyph_canvas.get_current_display ().zoom_in ();@@ -869,7 +869,7 @@ public class DrawingTools : ToolCollection { view_tools.add_tool (zoom_in); zoom_in.set_tool_visibility (false); - Tool zoom_out = new Tool ("zoom_out", "", '-', CTRL);+ Tool zoom_out = new Tool ("zoom_out", "Zoom Out"); zoom_out.select_action.connect ((self) => { zoom_tool.store_current_view (); glyph_canvas.get_current_display ().zoom_out ();@@ -877,7 +877,7 @@ public class DrawingTools : ToolCollection { view_tools.add_tool (zoom_out); zoom_out.set_tool_visibility (false); - Tool reset_zoom = new Tool ("zoom_1_1", t_("Use one pixel per unit"), '0', CTRL);+ Tool reset_zoom = new Tool ("zoom_1_1", t_("Zoom Out More")); reset_zoom.select_action.connect ((self) => { zoom_tool.store_current_view (); glyph_canvas.get_current_display ().reset_zoom ();@@ -893,7 +893,7 @@ public class DrawingTools : ToolCollection { }); view_tools.add_tool (full_glyph); - Tool zoom_boundaries = new Tool ("zoom_boundaries", t_("Fit in view"), 'v');+ Tool zoom_boundaries = new Tool ("zoom_boundaries", t_("Fit in view")); zoom_boundaries.select_action.connect((self) => { zoom_tool.store_current_view (); glyph_canvas.get_current_display ().zoom_max ();@@ -36,7 +36,7 @@ public class ForesightTool : Tool { Path current_path = new Path (); public ForesightTool (string name) {- base (name, t_ ("Create Beziér curves"), '.', CTRL);+ base (name, t_ ("Create Beziér curves")); select_action.connect ((self) => { state = NONE;@@ -32,7 +32,7 @@ class GridTool : Tool { public GridTool (string n) { string units;- base (n, t_("Show grid"), 'g', NONE);+ base (n, t_("Show grid")); units = Preferences.get ("ttf_units"); if (units == "true") {@@ -68,7 +68,7 @@ public class KerningTools : ToolCollection { }); kerning_tools.add_tool (insert_last); - Tool insert_unicode = new Tool ("insert_unichar", t_("Insert character by unicode value"), 'U', CTRL);+ Tool insert_unicode = new Tool ("insert_unichar", t_("Insert character by unicode value")); insert_unicode.select_action.connect ((self) => { KerningDisplay d = MainWindow.get_kerning_display (); d.insert_unichar ();@@ -563,8 +563,7 @@ public class Menu : GLib.Object { foreach (Expander e in tool_set.get_expanders ()) { foreach (Tool t in e.tool) { tool_item = new ToolItem (t);- if (tool_item.identifier != "") {- remove_menu_item (tool_item.identifier);+ if (tool_item.identifier != "" && !has_menu_item (tool_item.identifier)) { menu_items.set (tool_item.identifier, tool_item); sorted_menu_items.add (tool_item); }@@ -573,16 +572,15 @@ public class Menu : GLib.Object { } } - public void remove_menu_item (string identifier) {+ public bool has_menu_item (string identifier) { int i = 0; foreach (MenuItem mi in sorted_menu_items) { if (mi.identifier == identifier) {- sorted_menu_items.remove_at (i);- break;+ return true; } } - menu_items.unset (identifier);+ return false; } public void set_menu (SubMenu m) {@@ -638,7 +636,7 @@ public class Menu : GLib.Object { os.put_string ("\n"); os.put_string ("<bindings>\n");- foreach (MenuItem item in menu_items.values) {+ foreach (MenuItem item in sorted_menu_items) { os.put_string ("\t<action "); os.put_string (@"key=\"$((!)item.key.to_string ())\" ");@@ -38,7 +38,7 @@ public class MoveTool : Tool { public signal void objects_deselected (); public MoveTool (string n) {- base (n, t_("Move paths"), 'm', CTRL);+ base (n, t_("Move paths")); select_action.connect((self) => { Glyph glyph = MainWindow.get_current_glyph ();@@ -21,7 +21,7 @@ namespace BirdFont { public class PointTool : Tool { public PointTool (string name) {- base (name, t_ ("Move control points"), '.', CTRL);+ base (name, t_ ("Move control points")); select_action.connect ((self) => { });new file mode 100644@@ -0,0 +1,110 @@+<?xml version="1.0" encoding="utf-8" standalone="yes"?>+<bindings>+ <action key="n" ctrl="true" alt="false" command="false" shift="false" action="new" />+ <action key="o" ctrl="true" alt="false" command="false" shift="false" action="open" />+ <action key="r" ctrl="true" alt="false" command="false" shift="false" action="recent files" />+ <action key="s" ctrl="true" alt="false" command="false" shift="false" action="save" />+ <action key="S" ctrl="true" alt="false" command="false" shift="true" action="save as" />+ <action key="e" ctrl="true" alt="false" command="false" shift="false" action="export" />+ <action key="p" ctrl="true" alt="false" command="false" shift="false" action="preview" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="name and description" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="select character set" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="quit" />+ <action key="z" ctrl="true" alt="false" command="false" shift="false" action="undo" />+ <action key="Z" ctrl="true" alt="false" command="false" shift="true" action="redo" />+ <action key="c" ctrl="true" alt="false" command="false" shift="false" action="copy" />+ <action key="v" ctrl="true" alt="false" command="false" shift="false" action="paste" />+ <action key="V" ctrl="true" alt="false" command="false" shift="true" action="paste in place" />+ <action key="a" ctrl="true" alt="false" command="false" shift="false" action="select all paths" />+ <action key="b" ctrl="false" alt="false" command="false" shift="false" action="move to baseline" />+ <action key="f" ctrl="true" alt="false" command="false" shift="false" action="search" />+ <action key="E" ctrl="true" alt="false" command="false" shift="true" action="export glyph as svg" />+ <action key="i" ctrl="true" alt="false" command="false" shift="false" action="import svg file" />+ <action key="b" ctrl="true" alt="false" command="false" shift="false" action="import background image" />+ <action key="p" ctrl="false" alt="false" command="false" shift="false" action="simplify path" />+ <action key="c" ctrl="false" alt="false" command="false" shift="false" action="close path" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="glyph sequence" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="set background glyph" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="remove background glyph" />+ <action key="r" ctrl="true" alt="false" command="false" shift="false" action="select point above" />+ <action key="s" ctrl="true" alt="false" command="false" shift="false" action="select next point" />+ <action key="q" ctrl="true" alt="false" command="false" shift="false" action="select previous point" />+ <action key="t" ctrl="true" alt="false" command="false" shift="false" action="select point below" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="next tab" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="previous tab" />+ <action key="w" ctrl="true" alt="false" command="false" shift="false" action="close tab" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="close all tabs" />+ <action key="k" ctrl="true" alt="false" command="false" shift="false" action="show kerning tab" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="list kerning pairs" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="show spacing tab" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="select next kerning pair" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="select previous kerning pair" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="show ligature tab" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="add ligature" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="save as .bfp" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="settings" />+ <action key="b" ctrl="false" alt="false" command="false" shift="false" action="foresight" />+ <action key="n" ctrl="false" alt="false" command="false" shift="false" action="pen_tool" />+ <action key="m" ctrl="false" alt="false" command="false" shift="false" action="point_tool" />+ <action key="z" ctrl="false" alt="false" command="false" shift="false" action="zoom_tool" />+ <action key="o" ctrl="false" alt="false" command="false" shift="false" action="move" />+ <action key="r" ctrl="false" alt="false" command="false" shift="false" action="resize" />+ <action key="f" ctrl="false" alt="false" command="false" shift="false" action="track" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="move_background" />+ <action key="h" ctrl="false" alt="false" command="false" shift="false" action="move_canvas" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="quadratic_points" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="cubic_points" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="double_points" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="convert_point" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="x_coordinate" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="y_coordinate" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="rotation" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="skew" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="width" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="height" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="object_stroke" />+ <action key="w" ctrl="false" alt="false" command="false" shift="false" action="tie_point" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="symmetric" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="create_line" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="reverse_path" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="move_layer" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="flip_vertical" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="flip_horizontal" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="scale_background" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="cut_background" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="show_background" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="insert_background" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="high_contrast_background" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="contrast_threshold" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="auto_trace_resolution" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="auto_trace_simplify" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="autotrace" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="delete_background" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="help_lines" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="show_xheight_helplines" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="background_help_lines" />+ <action key="g" ctrl="false" alt="false" command="false" shift="false" action="show_grid" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="zoom_in" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="zoom_out" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="zoom_1_1" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="full_glyph" />+ <action key="v" ctrl="false" alt="false" command="false" shift="false" action="zoom_boundaries" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="zoom_background_image" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="prev" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="next" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="circle" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="rectangle" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="test_case" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="slow_test" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="kerning_class" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="kerning_text_input" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="side_bearings" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="insert_last_glyph" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="insert_unichar" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="kerning_font_size_one" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="kerning_font_size_two" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="update_webview" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="export_fonts" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="generate_html_document" />+ <action key="" ctrl="false" alt="false" command="false" shift="false" action="select_background" />+</bindings>