Bug 141708

Summary: Remember scroll position per view
Product: [Applications] digikam Reporter: Thomas McGuire <mcguire>
Component: Usability-ErgonomyAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: wishlist CC: caulier.gilles, marcel.wiesweg
Priority: NOR Flags: marcel.wiesweg: Junior_Jobs+
Version: 0.10.0   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In: 7.6.0
Sentry Crash Report:

Description Thomas McGuire 2007-02-14 22:28:17 UTC
Version:           SVN (using KDE KDE 3.5.6)
Installed from:    Compiled From Sources
OS:                Linux

Please remember the scroll position of all views (albums,tags,dates and searches).

Currently, the scroll position is reset when changing views.

Example:
Let's say I am viewing some photos in the album view and my scrollbar is at a position near the end. Now I change to the tag view and then back to the album view.
Now the scollbar of the album view is at the beginning, whereas I would like the scrollbar position to be where I left it before switching to the tag view.

In short, the positions of the scrollbars of all views should be remembered and restored each time I switch a view.


Another issue with the scrollbar is that the position gets reset when the right hand side tabbar is opened. 
Instead, digikam should remember one of the pictures currently visible and ensure that, after the sidebar has opened, this picture is still visible.
Comment 1 Marcel Wiesweg 2007-02-17 23:01:11 UTC
SVN commit 634637 by mwiesweg:

Remember scroll position when resizing

CCBUG: 141708


 M  +1 -4      iconview.cpp  


--- trunk/extragear/graphics/digikam/digikam/iconview.cpp #634636:634637
@@ -754,10 +754,7 @@
 void IconView::resizeEvent(QResizeEvent* e)
 {
     QScrollView::resizeEvent(e);
-    rearrangeItems();
-
-    if (d->currItem)
-        ensureItemVisible(d->currItem);
+    triggerUpdate();
 }
 
 void IconView::rebuildContainers()
Comment 2 Christian Engels 2007-04-13 19:27:24 UTC
It would also be nice if the last selected picture is selected, even after exit and restart digikam.
Comment 3 caulier.gilles 2008-03-19 13:24:24 UTC
Marcel, 

You patch from commit # 634637 is really enough ?

If you open/close a sidebar more than one time, you will see than scroll position is lost... Same when main window is resized...

Gilles Caulier

Comment 4 Marcel Wiesweg 2008-03-19 22:33:08 UTC
The current solution is simple, only one item is stored and we make sure that this item is visible after the resize. This may not be the item the user looked at, but the loss in scroll position is only small. But other solutions (list of items) are more difficult.
Comment 5 caulier.gilles 2008-03-19 22:40:50 UTC
Marcel, 

...and it's work for you. Here it doesn't...

Gilles
Comment 6 Marcel Wiesweg 2008-03-21 15:35:24 UTC
Always look at the first visible item before resizing. This item is still visible after resizing. But: it need not still be the first visible item, it need only be visible somewhere. This means after the next resize another item will be the first visible item, for which only there is the guarantee that it will be visible after the next resize...
Comment 7 Arnd Baecker 2008-04-11 10:21:22 UTC
Marcel, 

keeping the current image visible does not work for me with current svn: 
neither for resizing nor for the case
of the original report of openening and closing the right-sidebar.

Is there any way to store (and restore) the slider position itself?

Best, Arnd
Comment 8 Marcel Wiesweg 2008-04-12 17:36:06 UTC
Interesting idea.
QScrollView provides access to its scroll bars (horizontalScrollBar(), verticalScrollBar()), and the bars allow to get and set their value().
Comment 9 Dik Takken 2008-05-18 12:16:10 UTC
Another use case: I'm merging two albums into one. I need to switch between the two albums many times. Every time I switch, the album view position is reset to the upper row of the album. Quite annoying.
Comment 10 Arnd Baecker 2008-05-18 12:40:56 UTC
Dik, but this would mean to store the position for each album right?
(I.e., currently the wish is to store the position for the different types of views: album, dates, ... etc.).
Still your wish makes sense to me, but will be more complicated to implement.
(In particular, I am not sure, what happens/should happen, 
if one changes the icon size
or the width of the sidebar in the mean-time ...)

Marcel, Gilles, what do you think?
Comment 11 caulier.gilles 2008-12-06 15:31:55 UTC
Marcel,

What's news about this file ?

Gilles Caulier
Comment 12 Marcel Wiesweg 2008-12-06 16:50:43 UTC
I take this as a wish for 0.10 and the view part of model/view.
Comment 13 caulier.gilles 2011-02-11 05:47:10 UTC
Marcel,

It's fixed npw ?

Gilles
Comment 14 Marcel Wiesweg 2011-02-11 21:03:20 UTC
After a short test: Yes, fixed. Anyone who objects may reopen.