Clone in a terminal:
Commit cf60eff
Johan Mattsson - 2014-02-10T10:28:39+00:00
cf60efff4c9ea82e818cde81f753b79713566cadjohan.mattsson.m@gmail.com

Expanders

Changed files (4)

Diff

diff --git a/birdfont/GtkWindow.vala b/birdfont/GtkWindow.valaindex 6d5272b..66901e9 100644--- a/birdfont/GtkWindow.vala+++ b/birdfont/GtkWindow.vala@@ -933,7 +933,7 @@ class ToolboxCanvas : DrawingArea { 		 		add_events (EventMask.BUTTON_PRESS_MASK | EventMask.BUTTON_RELEASE_MASK | EventMask.POINTER_MOTION_MASK | EventMask.LEAVE_NOTIFY_MASK | EventMask.SCROLL_MASK); -		set_size_request (160, 100);+		set_size_request (170, 100);  		leave_notify_event.connect ((t, e)=> { 			tb.reset_active_tool ();diff --git a/libbirdfont/Expander.vala b/libbirdfont/Expander.valaindex 0e1ebdf..abba4bb 100644--- a/libbirdfont/Expander.vala+++ b/libbirdfont/Expander.vala@@ -28,7 +28,7 @@ public class Expander : GLib.Object { 	 	public double margin = 0; 	-	protected double opacity = 0.5;+	protected double opacity = 0; 	 	protected bool active = false; 	protected bool open = false;@@ -71,7 +71,7 @@ public class Expander : GLib.Object { 	 	private void update_tool_position () { 		double scale = Toolbox.get_scale ();-		double margin_small = 4 * scale;+		double margin_small = 5 * scale; 		double xt = x; 		double yt = y + scroll + margin_small; 		bool new_row = false;@@ -189,19 +189,10 @@ public class Expander : GLib.Object { 		cr.save (); 		cr.set_line_width (0.5); 		cr.set_source_rgba (0, 0, 0, 0.25);-		cr.move_to (x + w + 7, yt);+		cr.move_to (x, yt); 		cr.line_to (wd - w - x + 4, yt);	 		cr.stroke (); 		cr.restore ();--		// box-		cr.save ();-		cr.set_line_join (LineJoin.ROUND);-		cr.set_line_width (7);-		cr.set_source_rgba (0.75, 0.75, 0.75, opacity);-		cr.rectangle (x, yt - 3, w, h);-		cr.stroke ();-		cr.restore (); 		 		// arrow 		cr.save ();@@ -213,9 +204,9 @@ public class Expander : GLib.Object { 			cr.line_to (x + iw2 + 3, yt);	 			cr.line_to (x - iw2 + 3, ih2 + yt - 0.7); 		} else {-			cr.move_to (x - iw2 + 3, yt - ih2 - 0.7);-			cr.line_to (x + iw2 + 3, yt - ih2 - 0.7);-			cr.line_to (x + iw2, yt + 2);	+			cr.move_to (x - iw2 + 3, yt - ih2 - 0.7 + 1);+			cr.line_to (x + iw2 + 3, yt - ih2 - 0.7 + 1);+			cr.line_to (x + iw2, yt + 2 + 1);	 		} 		cr.close_path(); 		cr.stroke ();diff --git a/libbirdfont/KerningRange.vala b/libbirdfont/KerningRange.valaindex 057199a..e372d7f 100644--- a/libbirdfont/KerningRange.vala+++ b/libbirdfont/KerningRange.vala@@ -101,7 +101,7 @@ public class KerningRange : Tool { 	public override void draw (Context cr) { 		double xt, yt; -		xt = x + 10;+		xt = x + 5; 		yt = y + 10; 		 		cr.save ();diff --git a/libbirdfont/Toolbox.vala b/libbirdfont/Toolbox.valaindex a538825..83feef8 100644--- a/libbirdfont/Toolbox.vala+++ b/libbirdfont/Toolbox.vala@@ -322,7 +322,7 @@ public class Toolbox : GLib.Object  { 	 	public void update_expanders () { 		double pos;-+		 		foreach (Expander e in current_set.get_expanders ()) { 			e.set_scroll (current_set.scroll); 		}@@ -330,9 +330,19 @@ public class Toolbox : GLib.Object  { 		pos = 4 * get_scale (); 		foreach (Expander e in current_set.get_expanders ()) { 			e.set_offset (pos);-			pos += e.get_content_height () + 4 * get_scale ();+			+			if (e.is_open ()) {+				pos += e.get_content_height () + 4 * get_scale ();+			} else {+				pos += 10 * get_scale ();+			}+			 			current_set.content_height = pos; 		}++		foreach (Expander e in current_set.get_expanders ()) {+			e.set_active (false);+		} 	} 	 	private void draw_expanders (int w, int h, Context cr) {

Contact

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