Clone in a terminal:
Commit 22062f2
Johan Mattsson - 2015-03-26T08:03:05+00:00
22062f2665c800610fdc50506c28e9b06ab24e43johan.mattsson.m@gmail.com

Fix text input in spacing tab

Changed files (2)

Diff

diff --git a/libbirdfont/SpacingTab.vala b/libbirdfont/SpacingTab.valaindex 6494b39..c978638 100644--- a/libbirdfont/SpacingTab.vala+++ b/libbirdfont/SpacingTab.vala@@ -173,11 +173,28 @@ public class SpacingTab : KerningDisplay { 	} 	 	public override void button_press (uint button, double ex, double ey) {+		if (button == 3) {+			return;+		}+		+		if (!(ey >= allocation.height - height)) {+			base.button_press (button, ex, ey);+		}+	}+	+	public override void button_release (int button, double ex, double ey) { 		GlyphSequence row; 		double p; 		Font font = BirdFont.get_current_font (); 		+		if (button == 3) {+			return;+		}+		 		if (ey >= allocation.height - height) {+			+			TabContent.hide_text_input ();+			 			// TODO: add button for processing ligatures 			row = get_first_row ().process_ligatures (font); 			p = 0;@@ -193,16 +210,6 @@ public class SpacingTab : KerningDisplay { 				p += box_size; 			} 		} else {-			base.button_press (button, ex, ey);-		}-	}-	-	public override void button_release (int button, double ex, double ey) {-		if (button == 3) {-			return;-		}-		-		if (!(ey >= allocation.height - height)) { 			base.button_release (button, ex, ey); 		} 	}@@ -216,13 +223,13 @@ public class SpacingTab : KerningDisplay { 			return; 		} 		+		text_input_glyph = (!) g; 		l = text_input_glyph.get_left_side_bearing ();  		if (Math.fabs (l) < 0.001) { 			l = 0; 		} 				-		text_input_glyph = (!) g; 		listener = new TextListener (t_("Left"), @"$(l)", t_("Set")); 		 		listener.signal_text_input.connect ((text) => {@@ -255,18 +262,18 @@ public class SpacingTab : KerningDisplay { 		TextListener listener; 		string submitted_value = ""; 		double r;-		+ 		if (g == null) { 			return; 		} 		+		text_input_glyph = (!) g; 		r = text_input_glyph.get_right_side_bearing ();  		if (Math.fabs (r) < 0.001) { 			r = 0; 		}-					-		text_input_glyph = (!) g;+ 		listener = new TextListener (t_("Right"), @"$(r)", t_("Set")); 		 		listener.signal_text_input.connect ((text) => {diff --git a/libbirdfont/TabContent.vala b/libbirdfont/TabContent.valaindex 84590ec..ba04bb0 100644--- a/libbirdfont/TabContent.vala+++ b/libbirdfont/TabContent.vala@@ -349,6 +349,7 @@ public class TabContent : GLib.Object { 	 	public static void hide_text_input () { 		text_input_visible = false;+		text_callback = new TextListener ("", "", ""); 	} } 

Contact

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