Clone in a terminal:
Commit bab18d1
Johan Mattsson - 2013-09-13T16:41:22+00:00
bab18d1b258cd995cc6123063900c10d9c2aeabcjohan.mattsson.m@gmail.com

new button

Changed files (8)

Diff

diff --git a/icons/tool_button_deselected.png b/icons/tool_button_deselected.pngindex 54fa1f1..3726860 100644Binary files a/icons/tool_button_deselected.png and b/icons/tool_button_deselected.png differdiff --git a/icons/tool_button_selected.png b/icons/tool_button_selected.pngindex 01121e6..1c8e8e9 100644Binary files a/icons/tool_button_selected.png and b/icons/tool_button_selected.png differdiff --git a/icons/toolbox_background.png b/icons/toolbox_background.pngdeleted file mode 100644index 20e3adc..0000000Binary files a/icons/toolbox_background.png and /dev/null differdiff --git a/libbirdfont/CharDatabase.vala b/libbirdfont/CharDatabase.valaindex 509df7e..9b8be73 100644--- a/libbirdfont/CharDatabase.vala+++ b/libbirdfont/CharDatabase.vala@@ -41,7 +41,8 @@ public class CharDatabase { 		if (!database_is_loaded) { 			show_loading_message (); 		}-		++		return_val_if_fail (!is_null (index), result);		 		return_val_if_fail (result.get_length () == 0, result); 		 		if (s.has_prefix ("U+") || s.has_prefix ("u+")) {@@ -56,7 +57,11 @@ public class CharDatabase { 			result.add_single (s.get_char ());  		} 		+		return_val_if_fail (!is_null (index.get (s)), result);+		 		for (var it = index.get (s).iterator (); it.has_next (); it.next ()) {+			return_val_if_fail (!is_null (it), result);+			 			iv = it.get (); 			if (iv != null) { 				i = (string) iv;diff --git a/libbirdfont/Tab.vala b/libbirdfont/Tab.valaindex 220d731..74e49f5 100644--- a/libbirdfont/Tab.vala+++ b/libbirdfont/Tab.vala@@ -38,10 +38,6 @@ public class Tab : GLib.Object { 		return display; 	} 	-	public string get_label () {-		return display.get_name ();-	}-	 	public double get_width () { 		return width; 	}diff --git a/libbirdfont/TabBar.vala b/libbirdfont/TabBar.valaindex c37af80..23dcf38 100644--- a/libbirdfont/TabBar.vala+++ b/libbirdfont/TabBar.vala@@ -124,7 +124,7 @@ public class TabBar : GLib.Object { 	public bool select_char (string s) { 		int i = 0; 		foreach (Tab t in tabs) {-			if (t.get_label () == s) {+			if (t.get_display ().get_name () == s) { 				select_tab (i); 				return true; 			}@@ -233,7 +233,7 @@ public class TabBar : GLib.Object { 		int i = 0; 		 		foreach (var t in tabs) {-			if (t.get_label () == name) {+			if (t.get_display ().get_name () == name) { 				return close_tab (i, background_tab); 			} 			@@ -272,7 +272,7 @@ public class TabBar : GLib.Object {  	public Tab? get_tab (string name) { 		foreach (var n in tabs) {-			if (n.get_label () == name) {+			if (n.get_display ().get_name () == name) { 				return n; 			} 		}@@ -283,7 +283,7 @@ public class TabBar : GLib.Object { 	public bool selected_open_tab_by_name (string t) { 		int i = 0; 		foreach (var n in tabs) {-			if (n.get_label () == t) {+			if (n.get_display ().get_name () == t) { 				select_tab (i); 				return true; 			}@@ -562,7 +562,7 @@ public class TabBar : GLib.Object { 			cr.set_source_rgba (0, 0, 0, 1); 			cr.set_font_size (14); 			cr.move_to (8, height - 6);-			cr.show_text (t.get_label ());+			cr.show_text (t.get_display ().get_label ()); 			cr.stroke (); 			 			// edgesdiff --git a/libbirdfont/Tool.vala b/libbirdfont/Tool.valaindex 602acf6..2829d9d 100644--- a/libbirdfont/Tool.vala+++ b/libbirdfont/Tool.vala@@ -241,7 +241,7 @@ public class Tool : GLib.Object { 			ImageSurface i = (!) icon; 			 			if (likely (i.status () == Cairo.Status.SUCCESS)) {-				cr.set_source_surface (i, xt + (15 - i.get_width () / 2) - 5.7, yt + (15 - i.get_height ()) / 2.0);+				cr.set_source_surface (i, xt + (15.5 - i.get_width () / 2.0) - 5.7, yt + (15 - i.get_height ()) / 2.0); 				cr.paint (); 			} else { 				warning (@"Falied to load icon for $name");@@ -254,8 +254,10 @@ public class Tool : GLib.Object { 	/** Run pending events in main loop before continuing. */ 	public static void @yield () { 		int t = 0;-		var time = new TimeoutSource (500);+		TimeoutSource time = new TimeoutSource (500); 		bool timeout;+		unowned MainContext context;+		bool acquired;  		if (TestBirdFont.is_slow_test ()) { 			timeout = false;@@ -270,29 +272,24 @@ public class Tool : GLib.Object { 			timeout = true; 		}     -		unowned MainContext c = MainContext.default ();-		bool a = c.acquire ();+		context = MainContext.default ();+		acquired = context.acquire (); 		-		while (unlikely (!a)) {+		while (unlikely (!acquired)) { 			warning ("Failed to acquire main loop.\n"); 			return; 		} -		while (c.pending () || TestBirdFont.is_slow_test ()) {-			c.iteration (true);+		while (context.pending () || TestBirdFont.is_slow_test ()) {+			context.iteration (true); 			t++; -			if (!c.pending () && TestBirdFont.is_slow_test ()) {+			if (!context.pending () && TestBirdFont.is_slow_test ()) { 				if (timeout) break; 			}-						-			if (unlikely (t > 100000)) {-				assert (false);-				break;-			} 		} 		-		c.release ();+		context.release (); 	} 	 	public void set_persistent (bool p) {diff --git a/libbirdfont/Toolbox.vala b/libbirdfont/Toolbox.valaindex d585cc3..b3fcc5f 100644--- a/libbirdfont/Toolbox.vala+++ b/libbirdfont/Toolbox.vala@@ -43,7 +43,7 @@ public class Toolbox : GLib.Object  { 		toolbox_background = Icons.get_icon ("toolbox_background.png"); 		 		tab_bar.signal_tab_selected.connect ((tab) => {-			if (tab.get_label () == "Kerning") {+			if (tab.get_display ().get_name () == "Kerning") { 				current_set = kerning_tools; 			} else { 				current_set = drawing_tools;@@ -72,6 +72,12 @@ public class Toolbox : GLib.Object  { 	 	public void press (uint button, double x, double y) { 		foreach (Expander exp in current_set.get_expanders ()) {+			if (exp.is_over (x, y)) {+				exp.set_open (! exp.is_open ());					+				update_expanders ();			+				redraw_tool_box ();+			}+			 			foreach (Tool t in exp.tool) { 				if (t.is_over (x, y)) { 					t.panel_press_action (t, button, x, y);@@ -82,13 +88,7 @@ public class Toolbox : GLib.Object  { 	} 	 	public void release (uint button, double x, double y) {-		foreach (Expander exp in current_set.get_expanders ()) {-			if (exp.is_over (x, y)) {-				exp.set_open (! exp.is_open ());					-				update_expanders ();			-				redraw_tool_box ();-			}-			+		foreach (Expander exp in current_set.get_expanders ()) {			 			if (exp.is_open ()) { 				foreach (Tool t in exp.tool) { 					bool active = t.is_over (x, y);@@ -324,14 +324,9 @@ public class Toolbox : GLib.Object  { 		 		cr.rectangle(0, 0, w, h); 		cr.set_line_width(0);-		cr.set_source_rgba(255/255.0, 255/255.0, 255/255.0, 1);+		cr.set_source_rgba(242/255.0, 241/255.0, 240/255.0, 1); 		cr.fill();--		for (int i = 0; i < w; i++) {-			cr.set_source_surface ((!) toolbox_background, i, 0);-			cr.paint ();-		}-+		 		cr.rectangle(0, 0, 1, h); 		cr.set_line_width(0); 		cr.set_source_rgba(0/255.0, 0/255.0, 0/255.0, 1);

Contact

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