From f68a12de0405e988e49bfdbd2830fff51c3cdbb5 Mon Sep 17 00:00:00 2001 From: Daniel Danopia Date: Wed, 3 Mar 2010 19:22:32 -0500 Subject: [PATCH] Make sure both clicks of a Doubleclick are on the same item --- ui/listbox.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/listbox.rb b/ui/listbox.rb index 12259c2..4d4e323 100644 --- a/ui/listbox.rb +++ b/ui/listbox.rb @@ -143,6 +143,8 @@ def handle_click button, modifiers, x, y end @lastclick = Time.now + previous = @index + row = y1 data[@offset, height].each_with_index do |line, index| _height = line_height(line) @@ -157,7 +159,7 @@ def handle_click button, modifiers, x, y end end - handler.call self, @data[@index] if button == :double && handler + handler.call self, @data[@index] if button == :double && previous == @index && handler end redraw