int x = (int)event.x;
if (x < allocation.width / 3)
{
- Gtk.TreeIter iter;
- if (model.iter_nth_child(out iter, null, label_cache[cur_el].index))
+ if (label_cache[cur_el].index == -1)
{
- Gtk.TreePath path = model.get_path(iter);
- row_activated(path);
+ // The case of "reset filter"
+ prefix_filter = null;
+ } else {
+ Gtk.TreeIter iter;
+ if (model.iter_nth_child(out iter, null, label_cache[cur_el].index))
+ {
+ Gtk.TreePath path = model.get_path(iter);
+ row_activated(path);
+ }
}
} else if (cur_pfx != null && x > allocation.width * 2 / 3) {
//stderr.printf("Mouse released on prefix %s\n", cur_pfx.prefix);
else
{
int count = model.iter_n_children(null);
- label_cache = new LabelInfo[count];
+ label_cache = new LabelInfo[count + 1];
int lc_idx = 0;
int model_idx = 0;
}
++model_idx;
} while (model.iter_next(ref iter));
+ if (_prefix_filter != null)
+ {
+ label_cache[lc_idx].label = "(reset prefix)";
+ label_cache[lc_idx].index = -1;
+ ++lc_idx;
+ }
prefixes.append(pi);
label_count = lc_idx;
}