From e76236f4739b9deee107c09b9b2f9a87c537c9a7 Mon Sep 17 00:00:00 2001 From: Monsta Date: Wed, 24 Jun 2015 16:54:28 +0300 Subject: compact view: don't auto-scroll to the right on long filenames however, now it will auto-scroll to the left if you manually scroll to the right and then click on any filename. I presume this behavior is more desired than the previous one. if it's not so, let me know (in the comments). adapted from https://github.com/linuxmint/nemo/commit/72c2214c82637ab622438d46c28e67289a49d472 (thanks to @glebihan) fixes https://github.com/mate-desktop/caja/issues/406 --- libcaja-private/caja-icon-container.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libcaja-private/caja-icon-container.c b/libcaja-private/caja-icon-container.c index 5db10601..3757dabc 100644 --- a/libcaja-private/caja-icon-container.c +++ b/libcaja-private/caja-icon-container.c @@ -763,15 +763,17 @@ reveal_icon (CajaIconContainer *container, if (bounds.y0 < gtk_adjustment_get_value (vadj)) { eel_gtk_adjustment_set_value (vadj, bounds.y0); } else if (bounds.y1 > gtk_adjustment_get_value (vadj) + allocation.height) { - eel_gtk_adjustment_set_value - (vadj, bounds.y1 - allocation.height); + eel_gtk_adjustment_set_value (vadj, bounds.y1 - allocation.height); } if (bounds.x0 < gtk_adjustment_get_value (hadj)) { eel_gtk_adjustment_set_value (hadj, bounds.x0); } else if (bounds.x1 > gtk_adjustment_get_value (hadj) + allocation.width) { - eel_gtk_adjustment_set_value - (hadj, bounds.x1 - allocation.width); + if (bounds.x1 - allocation.width > bounds.x0) { + eel_gtk_adjustment_set_value (hadj, bounds.x0); + } else { + eel_gtk_adjustment_set_value (hadj, bounds.x1 - allocation.width); + } } } -- cgit v1.2.1