From 5eda4edeccd6ad2f0525240e752d0180eee9c4db Mon Sep 17 00:00:00 2001 From: Oliver Duis Date: Sun, 14 Nov 2010 16:08:55 +0100 Subject: [PATCH] Fixed issue #317 (filmstrip does not scroll to opened image when entering editor) --- rtgui/thumbbrowserbase.cc | 6 ++++++ rtgui/thumbbrowserentrybase.h | 1 + 2 files changed, 7 insertions(+) diff --git a/rtgui/thumbbrowserbase.cc b/rtgui/thumbbrowserbase.cc index 48f4d358b..76a16d92a 100644 --- a/rtgui/thumbbrowserbase.cc +++ b/rtgui/thumbbrowserbase.cc @@ -529,6 +529,12 @@ void ThumbBrowserBase::enableTabMode(bool enable) { refreshThumbImages(); else redraw(); + + // Scroll to selected position if going into ribbon mode + if (inTabMode && !selected.empty()) { + int h=selected[0]->getStartX(); + hscroll.set_value (MIN(h, hscroll.get_adjustment()->get_upper())); + } } void ThumbBrowserBase::initEntry (ThumbBrowserEntryBase* entry) { diff --git a/rtgui/thumbbrowserentrybase.h b/rtgui/thumbbrowserentrybase.h index abdf75046..9b06dbb3d 100644 --- a/rtgui/thumbbrowserentrybase.h +++ b/rtgui/thumbbrowserentrybase.h @@ -103,6 +103,7 @@ protected: int getMinimalWidth () { return width; } int getEffectiveHeight () { return fnlabh+dtlabh+exlabh+textGap+exp_height; } + int getStartX () { return startx; } bool inside (int x, int y); bool insideWindow (int x, int y, int w, int h);