Clone in a terminal:
Commit aa2f1ff
Johan Mattsson - 2015-05-29T07:25:29+00:00
aa2f1ffb03322209f228d7d358b3722088b58bcajohan.mattsson.m@gmail.com

Toolbox label

Changed files (4)

Diff

diff --git a/birdfont/GtkWindow.vala b/birdfont/GtkWindow.valaindex 924fee8..ceb45b8 100644--- a/birdfont/GtkWindow.vala+++ b/birdfont/GtkWindow.vala@@ -774,6 +774,7 @@ class ToolboxCanvas : DrawingArea { 		});  		motion_notify_event.connect ((sen, e)=> {+			// FIXME: e.y is two pixels off in GTK under Gnome 			tb.move (e.x, e.y); 			return true; 		});diff --git a/libbirdfont/Expander.vala b/libbirdfont/Expander.valaindex cf7f1db..f614e2c 100644--- a/libbirdfont/Expander.vala+++ b/libbirdfont/Expander.vala@@ -116,7 +116,7 @@ public class Expander : GLib.Object { 				t.h = 7 * scale; 			} else if (t is LabelTool) { 				t.w = Toolbox.allocation_width * scale;-				t.h = 15 * scale;+				t.h = 22 * scale; 			} else if (t is FontName) { 				t.w = Toolbox.allocation_width * scale; 				t.h = 20 * scale;@@ -150,7 +150,13 @@ public class Expander : GLib.Object { 					if (new_row && !first_row) { 						content_height += previous.h + margin_small;  						xt = x;-						yt += previous.h + 7 * scale;+						yt += previous.h;+						+						if (t is LabelTool) {+							yt += 0 * scale;+						} else {+							yt += 7 * scale;+						} 					} 				 					t.x = xt;diff --git a/libbirdfont/LabelTool.vala b/libbirdfont/LabelTool.valaindex 2072875..3e4e5ee 100644--- a/libbirdfont/LabelTool.vala+++ b/libbirdfont/LabelTool.vala@@ -25,8 +25,8 @@ public class LabelTool : Tool { 	public signal void delete_action (LabelTool self); 	public string data = ""; -	double counter_box_width = 24;-	double counter_box_height = 11;+	double counter_box_width = 24 * Toolbox.get_scale ();+	double counter_box_height = 11 * Toolbox.get_scale ();  	public LabelTool (string label) { 		base ();@@ -38,7 +38,7 @@ public class LabelTool : Tool { 		has_counter = false;  		panel_press_action.connect ((selected, button, tx, ty) => {-			if (has_delete_button && y <= ty <= y + h && tx >= w - 30) {+			if (has_delete_button && y <= ty <= y + h && tx >= w - 30 * Toolbox.get_scale ()) { 				delete_action (this); 			} 		});@@ -58,7 +58,7 @@ public class LabelTool : Tool { 		if (is_selected ()) { 			cr.save (); 			Theme.color (cr, "Menu Background");-			cr.rectangle (0, y - 2, w, h + 7);+			cr.rectangle (0, y - 2 * Toolbox.get_scale (), w, h ); // labels overlap with 2 pixels 			cr.fill (); 			cr.restore ();		 		}@@ -67,7 +67,7 @@ public class LabelTool : Tool { 		cr.save (); 		label_text = new Text (); 		label_text.set_text (label);-		text_height = 18 * Toolbox.get_scale ();+		text_height = 17 * Toolbox.get_scale ();  		if (is_selected ()) { 			Theme.text_color (label_text, "Text Tool Box");@@ -76,7 +76,7 @@ public class LabelTool : Tool { 		} 		 		label_text.set_font_size (text_height);-		label_text.draw_at_baseline (cr, x + 14, y + h - 1.5);+		label_text.draw_at_top (cr, x, y); 		cr.restore ();  		// glyph countdiff --git a/libbirdfont/Renderer/FallbackFont.vala b/libbirdfont/Renderer/FallbackFont.valaindex aa9c5f8..0863550 100644--- a/libbirdfont/Renderer/FallbackFont.vala+++ b/libbirdfont/Renderer/FallbackFont.vala@@ -77,7 +77,6 @@ public class FallbackFont : GLib.Object { 	public Font get_single_glyph_font (unichar c) { 		Font f; 		unichar last; -		int last_index; 		CachePair p; 		 		if (likely (glyphs.has_key (c))) {@@ -101,8 +100,6 @@ public class FallbackFont : GLib.Object { 			 			int j = 0; 			for (int i = cached.size - 1; i > 0; i--) {-				CachePair ca = cached.get (i);-				 				if (j > 100) { 					break; 				}

Contact

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