diff options
author | Monsta <[email protected]> | 2015-06-24 16:54:28 +0300 |
---|---|---|
committer | Monsta <[email protected]> | 2015-06-24 16:54:28 +0300 |
commit | e76236f4739b9deee107c09b9b2f9a87c537c9a7 (patch) | |
tree | 44b11f2b31fd5a07186a7ccfb498dcd75954f36a /libcaja-private | |
parent | 2726adabc5efab673c1607de3780b3303e7f8b17 (diff) | |
download | caja-e76236f4739b9deee107c09b9b2f9a87c537c9a7.tar.bz2 caja-e76236f4739b9deee107c09b9b2f9a87c537c9a7.tar.xz |
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
Diffstat (limited to 'libcaja-private')
-rw-r--r-- | libcaja-private/caja-icon-container.c | 10 |
1 files 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); + } } } |