From 5658c41922c82760ff69f07ddbb4f785179b4173 Mon Sep 17 00:00:00 2001 From: gc Date: Sun, 8 Jul 2007 17:21:21 +0000 Subject: [PATCH] use normal stuff for autoscrolling (allocation) thanks detlef reichl, autoscroll just the needed amount for full visibility for better user experience --- bin/booh-classifier | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/bin/booh-classifier b/bin/booh-classifier index 068a8f2..894c60a 100644 --- a/bin/booh-classifier +++ b/bin/booh-classifier @@ -408,21 +408,19 @@ def check_memory_free_cache_if_needed end def autoscroll_if_needed(button) - xpos_left = button.event_window.position[0] - xpos_right = button.event_window.position[0] + button.event_window.size[0] + xpos_left = button.allocation.x + xpos_right = button.allocation.x + button.allocation.width hadj = $imagesline_sw.hadjustment current_minx_visible = hadj.value current_maxx_visible = hadj.value + hadj.page_size if xpos_left < current_minx_visible #- autoscroll left - newval = hadj.value - - ((hadj.value - xpos_left - 1) / hadj.step_increment + 1) * hadj.step_increment + newval = hadj.value - (current_minx_visible - xpos_left) hadj.value = newval button.queue_draw #- TOREMOVE: the visual focus is displayed incorrectly elsif xpos_right > current_maxx_visible #- autoscroll right - newval = hadj.value + - ((xpos_right - (hadj.value + hadj.page_size) - 1) / hadj.step_increment + 1) * hadj.step_increment + newval = hadj.value + (xpos_right - current_maxx_visible) if newval > hadj.upper - hadj.page_size newval = hadj.upper - hadj.page_size end @@ -487,7 +485,8 @@ def open_dir(path) end Dir.entries(dir).each { |file| type = entry2type(file) - if type && $allentries.size < 5 + if type +#&& $allentries.size < 5 $allentries << Entry.new(File.join(dir, file), type) end } -- 2.30.4