Clone in a terminal:
Commit 5e9acab
Johan Mattsson - 2013-08-27T19:40:34+00:00
5e9acab0438a697a47b80165d0a1637c5c45d8d5johan.mattsson.m@gmail.com

let shape tools propagate events

Changed files (5)

Diff

diff --git a/libbirdfont/CharDatabase.vala b/libbirdfont/CharDatabase.valaindex 79d93b2..837e34c 100644--- a/libbirdfont/CharDatabase.vala+++ b/libbirdfont/CharDatabase.vala@@ -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) {diff --git a/libbirdfont/DrawingTools.vala b/libbirdfont/DrawingTools.valaindex ba1611e..b2dccba 100644--- a/libbirdfont/DrawingTools.vala+++ b/libbirdfont/DrawingTools.vala@@ -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 (() => {diff --git a/libbirdfont/Font.vala b/libbirdfont/Font.valaindex 21e6b06..73c96b3 100644--- a/libbirdfont/Font.vala+++ b/libbirdfont/Font.vala@@ -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'); 	}diff --git a/libbirdfont/ProgressBar.vala b/libbirdfont/ProgressBar.valaindex 1066a2f..d0d64f1 100644--- a/libbirdfont/ProgressBar.vala+++ b/libbirdfont/ProgressBar.vala@@ -37,6 +37,8 @@ class ProgressBar { 		p = (!) singleton; 		current_progress = d; 		p.new_progress ();+		+		MainWindow.get_tool_tip ().redraw (); 	}  	public static double get_progress () {diff --git a/libbirdfont/TooltipArea.vala b/libbirdfont/TooltipArea.valaindex af08917..f9583fd 100644--- a/libbirdfont/TooltipArea.vala+++ b/libbirdfont/TooltipArea.vala@@ -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 (); 	} } 

Contact

Email: johan.mattsson.m@gmail.com
Mastodon: typo.social/@birdfont
GitHub: johanmattssonm
LinkedIn: johan-mattsson-2ab324112