From 6322c3b0760d54f797dcac31287fe0ab3ded5dc8 Mon Sep 17 00:00:00 2001 From: Enrico Zini Date: Mon, 14 Dec 2009 17:56:09 +0000 Subject: [PATCH] Catch click on prefix area --- gtkfisheyelist/gtkfisheyelistview.vala | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gtkfisheyelist/gtkfisheyelistview.vala b/gtkfisheyelist/gtkfisheyelistview.vala index c07b1e1..88f0e96 100644 --- a/gtkfisheyelist/gtkfisheyelistview.vala +++ b/gtkfisheyelist/gtkfisheyelistview.vala @@ -183,10 +183,12 @@ public class FisheyeListView : Gtk.DrawingArea /* Mouse button got released */ public override bool button_release_event(Gdk.EventButton event) { + if (model == null) return false; //stderr.printf("Mouse released on %d %s\n", cur_el, label_cache[cur_el]); // Emit row_activated if applicable - if (model != null) + int x = (int)event.x; + if (x < allocation.width / 3) { Gtk.TreeIter iter; if (model.iter_nth_child(out iter, null, cur_el)) @@ -194,6 +196,8 @@ public class FisheyeListView : Gtk.DrawingArea 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); } return false; } -- 2.39.5