Commit cf60eff
Expanders
Changed files (4)
modifiedbirdfont/GtkWindow.valamodifiedlibbirdfont/Expander.valamodifiedlibbirdfont/KerningRange.valamodifiedlibbirdfont/Toolbox.vala
Diff
@@ -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 ();@@ -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 ();@@ -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 ();@@ -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) {