protected void base_layout()
{
background = new Gdk.Pixmap(window, allocation.width, allocation.height, -1);
- draw_background(background);
-
backing_store = new Gdk.Pixmap(window, allocation.width, allocation.height, -1);
// Recreate the renderers
renderers[renderers.length-1].set_fixed_height_from_font(1);
renderers[0] = make_cell_renderer();
- renderers[0].size = 1;
+ renderers[0].size = Pango.SCALE;
renderers[0].set_fixed_height_from_font(1);
for (int i = 1; i < renderers.length-1; ++i)
}
}
+ // Draw background
+ draw_background(background);
+
base_layout_needed = false;
focus_layout_needed = true;
}
// Background
drawable.draw_rectangle(style.bg_gc[Gtk.StateType.NORMAL], true, 0, 0, allocation.width, allocation.height);
- // Focus lock area
- drawable.draw_rectangle(style.bg_gc[Gtk.StateType.ACTIVE], true,
- 0, focus_starts[0], allocation.width/2, focus_starts[focus_end - focus_first]-focus_starts[0]);
+ // Focus movement area
+ drawable.draw_rectangle(style.bg_gc[Gtk.StateType.INSENSITIVE], true,
+ allocation.width/2, 0, allocation.width, allocation.height);
+
+ Gdk.Rectangle expose_area = Gdk.Rectangle();
+ expose_area.x = expose_area.y = 0;
+ expose_area.width = allocation.width;
+ expose_area.height = allocation.height;
+
+ stderr.printf("BG %d %d\n", label_cache.length, allocation.height);
+ if (label_cache.length >= allocation.height)
+ {
+ stderr.printf("LABELS\n");
+ Gdk.Rectangle cell_area = Gdk.Rectangle();
+ cell_area.x = 0;
+ cell_area.width = allocation.width;
+ cell_area.height = 1;
+ for (int y = 0; y < allocation.height; ++y)
+ {
+ int idx = y * label_cache.length / allocation.height;
+ cell_area.y = y;
+ renderers[0].text = label_cache[idx];
+ renderers[0].render((Gdk.Window*)drawable, this,
+ cell_area,
+ cell_area,
+ expose_area,
+ 0);
+ }
+ }
}
protected void draw()
0, 0, 0, 0,
allocation.width, allocation.height);
- // Focus movement area
- drawable.draw_rectangle(style.bg_gc[Gtk.StateType.INSENSITIVE], true,
- allocation.width/2, 0, allocation.width, allocation.height);
+ // Focus lock area
+ drawable.draw_rectangle(style.bg_gc[Gtk.StateType.ACTIVE], true,
+ 0, focus_starts[0], allocation.width/2, focus_starts[focus_end - focus_first]-focus_starts[0]);
// Paint items around focus
Gdk.Rectangle cell_area = Gdk.Rectangle();