ToastFreeware
/
gregoa
/
zavai.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added entry used to reset filter
[gregoa/zavai.git]
/
gtkfisheyelist
/
gtkfisheyelistview.vala
diff --git
a/gtkfisheyelist/gtkfisheyelistview.vala
b/gtkfisheyelist/gtkfisheyelistview.vala
index 10b790f5d055502bff347f98d4475f7129f1854d..4918269893e022b871e0cc0e1aa6d51d7b6b214a 100644
(file)
--- a/
gtkfisheyelist/gtkfisheyelistview.vala
+++ b/
gtkfisheyelist/gtkfisheyelistview.vala
@@
-209,11
+209,17
@@
public class FisheyeListView : Gtk.DrawingArea
int x = (int)event.x;
if (x < allocation.width / 3)
{
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 if (cur_pfx != null && x > allocation.width * 2 / 3) {
//stderr.printf("Mouse released on prefix %s\n", cur_pfx.prefix);
@@
-327,7
+333,7
@@
public class FisheyeListView : Gtk.DrawingArea
else
{
int count = model.iter_n_children(null);
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;
int lc_idx = 0;
int model_idx = 0;
@@
-351,6
+357,12
@@
public class FisheyeListView : Gtk.DrawingArea
}
++model_idx;
} while (model.iter_next(ref iter));
}
++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;
}
prefixes.append(pi);
label_count = lc_idx;
}