Commit 9abdea0
Fix tooltip
Changed files (2)
Diff
@@ -610,10 +610,16 @@ class ToolboxCanvas : DrawingArea { get_allocation (out allocation); Toolbox.allocation_width = allocation.width; Toolbox.allocation_height = allocation.height;+ Toolbox.redraw_tool_box (); }); tb.redraw.connect ((x, y, w, h) => {+ if (h < 0) {+ warning (@"Toolbox height is less than zero: $(h)");+ return;+ }+ queue_draw_area (x, y, w, h); }); @@ -632,7 +638,6 @@ 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; });@@ -641,11 +646,11 @@ class ToolboxCanvas : DrawingArea { Gtk.Allocation allocation; get_allocation (out allocation); - Context cw = e;- //cw = cairo_create((!) get_window());+ Context cw = cairo_create((!) get_window()); Toolbox.allocation_width = allocation.width; Toolbox.allocation_height = allocation.height;- tb.draw (allocation.width, allocation.height, cw);+ + tb.draw (Toolbox.allocation_width, Toolbox.allocation_height, cw); return true; });@@ -661,7 +666,8 @@ 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 (212, 100);+ int width = 212;+ set_size_request (width, 100); leave_notify_event.connect ((t, e)=> { tb.reset_active_tool ();@@ -516,16 +516,19 @@ public class Toolbox : GLib.Object { draw_tool_tip (cr); }- + private void draw_tool_tip (Context cr) { TextArea t; if (tool_tip != null && tool_tip != "") { t = new TextArea (17 * get_scale ());+ t.allocation = new WidgetAllocation.for_area (0, 0, allocation_width, allocation_height); t.set_editable (false); t.set_text ((!) tool_tip);+ t.width = allocation_width - 20 * get_scale ();+ t.min_height = 17 * get_scale (); t.height = 17 * get_scale ();