// Prefix information
protected List<PrefixInfo> prefixes;
+ protected Pango.Layout prefix_layout;
protected int cur_el;
+ protected weak PrefixInfo cur_pfx;
// Layout information
protected int focus_first;
renderers = new Gtk.CellRendererText[steps];
renderer_sizes = new int[steps];
+ prefix_layout = null;
// Defaults for properties
focus_size = 10;
label_column = 0;
cur_el = 0;
+ cur_pfx = null;
focus_locked = false;
add_events(Gdk.EventMask.POINTER_MOTION_MASK
break;
}
+ if (prefixes != null)
+ {
+ cur_pfx = prefixes.data;
+ for (weak List<PrefixInfo> i = prefixes; i != null && y > i.data.layout_pos; i = i.next)
+ cur_pfx = i.data;
+ } else {
+ cur_pfx = null;
+ }
+
if (!focus_locked && old_cur_el != cur_el)
focus_layout_needed = true;
} else {
}
// Draw prefix labels
- Pango.Layout layout = create_pango_layout(null);
+ prefix_layout = create_pango_layout(null);
Pango.Rectangle lr;
- layout.get_extents(null, out lr);
+ prefix_layout.get_extents(null, out lr);
int label_height = lr.height / Pango.SCALE;
- layout.set_alignment(Pango.Alignment.RIGHT);
- layout.set_width(allocation.width*Pango.SCALE/3);
- layout.set_height(0);
- layout.set_ellipsize(Pango.EllipsizeMode.END);
+ prefix_layout.set_alignment(Pango.Alignment.RIGHT);
+ prefix_layout.set_width(allocation.width*Pango.SCALE/3);
+ prefix_layout.set_height(0);
+ prefix_layout.set_ellipsize(Pango.EllipsizeMode.END);
int last_covered = 0;
{
if (i.data.layout_pos < last_covered)
i.data.layout_pos = last_covered;
- layout.set_text(i.data.prefix, int.max(10, (int)i.data.pfx_len));
- Gtk.paint_layout(style, (Gdk.Window*)drawable, Gtk.StateType.INSENSITIVE, true, null, this, null, allocation.width*2/3, i.data.layout_pos, layout);
+ prefix_layout.set_text(i.data.prefix, (int)i.data.pfx_len);
+ Gtk.paint_layout(style, (Gdk.Window*)drawable, Gtk.StateType.INSENSITIVE, true, null, this, null, allocation.width*2/3, i.data.layout_pos, prefix_layout);
last_covered = i.data.layout_pos + label_height;
}
}
if (is_fisheye)
{
+ // Paint current prefix
+ if (cur_pfx != null)
+ {
+ prefix_layout.set_text(cur_pfx.prefix, (int)cur_pfx.pfx_len);
+ Gtk.paint_layout(style, (Gdk.Window*)drawable, Gtk.StateType.NORMAL, true, null, this, null, allocation.width*2/3, cur_pfx.layout_pos, prefix_layout);
+ }
+
// Focus lock area
drawable.draw_rectangle(style.bg_gc[Gtk.StateType.ACTIVE], true,
0, focus_area_start + focus_info[0].y, allocation.width/3, focus_info[focus_end - focus_first].y);