Commit 5e9acab
let shape tools propagate events
Changed files (5)
modifiedlibbirdfont/CharDatabase.valamodifiedlibbirdfont/DrawingTools.valamodifiedlibbirdfont/Font.valamodifiedlibbirdfont/ProgressBar.valamodifiedlibbirdfont/TooltipArea.vala
Diff
@@ -24,6 +24,8 @@ public class CharDatabase { static GlyphRange full_unicode_range; static bool database_is_loaded = false; + static double lines_in_ucd = 38876;+ public CharDatabase () { entries = new HashMap<string, string> (); index = new HashMultiMap<string, string> ();@@ -74,10 +76,14 @@ public class CharDatabase { ucd_result.add_single (c); } }- - if (ucd_result.get_length () > 0) {- ucd_result.sort ();- result.parse_ranges (ucd_result.get_all_ranges ());+ + try {+ if (ucd_result.get_length () > 0) {+ ucd_result.sort ();+ result.parse_ranges (ucd_result.get_all_ranges ());+ }+ } catch (MarkupError e) {+ warning (e.message); } return result;@@ -144,6 +150,7 @@ public class CharDatabase { string data; string description = ""; File file;+ int line_number = 0; file = get_unicode_database (); @@ -168,6 +175,8 @@ public class CharDatabase { break; } + ProgressBar.set_progress (++line_number / lines_in_ucd);+ Tool.yield (); } @@ -247,7 +256,7 @@ public class CharDatabase { } static void show_loading_message () {- MainWindow.set_status (_("Loading the unicode database") + " ...");+ MainWindow.set_status (_("Loading the unicode character database") + " ..."); } public static void get_full_unicode (GlyphRange glyph_range) {@@ -705,19 +705,20 @@ public class DrawingTools : ToolCollection { t.editor_events = true; } + foreach (Tool t in shape_tools.tool) {+ t.editor_events = true;+ t.persistent = true;+ }+ move_background.editor_events = true; cut_background.editor_events = true; move_background.persistent = true; cut_background.persistent = true;- + precision.persistent = true; stroke_width.persistent = true; - foreach (Tool t in shape_tools.tool) {- t.persistent = true;- }- // Default selection IdleSource idle = new IdleSource (); idle.set_callback (() => {@@ -761,7 +761,10 @@ public class Font : GLib.Object { case 'f': return 15; } - return_val_if_fail ('0' <= o <= '9', 0);+ if (!('0' <= o <= '9')) {+ warning (@"Excpecting a number ($(s.str)).");+ return 0;+ } return (uint8) (o - '0'); }@@ -37,6 +37,8 @@ class ProgressBar { p = (!) singleton; current_progress = d; p.new_progress ();+ + MainWindow.get_tool_tip ().redraw (); } public static double get_progress () {@@ -129,13 +129,11 @@ public class TooltipArea : GLib.Object { cr.stroke (); cr.restore (); - if (w == 0) {- cr.save ();- cr.set_font_size (14);- cr.move_to (5, 15);- cr.show_text (tool_tip);- cr.restore ();- }+ cr.save ();+ cr.set_font_size (14);+ cr.move_to (5, 15);+ cr.show_text (tool_tip);+ cr.restore (); } }