Bug 267579 - Keep scroll position don't remember the picture viewed but the viewed line number
Summary: Keep scroll position don't remember the picture viewed but the viewed line nu...
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Albums-MainView (show other bugs)
Version: 2.0.0
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-03 20:40 UTC by Nicolas Boulesteix
Modified: 2012-06-29 08:46 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 2.6.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Boulesteix 2011-03-03 20:40:25 UTC
Version:           1.9.0 (using KDE 4.5.5) 
OS:                Linux

When I open/close a side panel or resizing one of them, Digikam "keep scroll position" functionality doesn't work as planned if that leads to a modification of the thumbnails rows number.

Instead of remember which thumbnail is displayed, digikam remembers which line was...



Reproducible: Always

Steps to Reproduce:
open/close or resizing a side panel in thumbnail view mode.

Actual Results:  
In a case where Digikam display 3 thumbnails rows and the thumbnail displayed in the top right corner is those of the 24th picture (meaning the last thumbnail of the 8th line), if I resize a panel to get only 2 rows of thumbnails, the top right corner picture after that will be those of the 16th picture (meaning the last of the 8th line).

If I increase the rows numbers it's the same math...

4 rows -> picture 32, 5->picture 40, 6-> picture 48....

Expected Results:  
Remember the scroll position based on the displayed picture number and not on the displayed line number.

If you can't reproduce, I can post screenshot if needed. Just ask for it.

Thanks
Comment 1 Marcel Wiesweg 2011-04-18 22:20:33 UTC
Git commit f82465d4f1f6166fb6d79b6708044f54a0437f18 by Marcel Wiesweg.
Committed on 18/04/2011 at 22:27.
Pushed by mwiesweg into branch 'master'.

Use improved scroll position hint to preserve scroll position across resize operations.
As we use topmost left, try to position that one on the top again.

CCBUG: 267579

M  +3    -2    libs/widgets/common/dcategorizedview.cpp     

http://commits.kde.org/digikam/f82465d4f1f6166fb6d79b6708044f54a0437f18
Comment 2 Marcel Wiesweg 2011-04-18 22:21:00 UTC
With latest changes in git, things work fine for. But I'm not quite sure I understand the actual problem described above.

I am testing these conditions:
1) The reference picture is topmost left
2) After any resizing, the reference picture should be visible. Not necessarily at the top, that may not be possible.
Comment 3 caulier.gilles 2011-12-14 09:44:19 UTC
Nicolas,

Do you see comment #2 from Marcel ?

Gilles Caulier
Comment 4 Nicolas Boulesteix 2011-12-14 21:27:51 UTC
Sorry, I didn't see it (or remember to see) it.

Actually (on Digikam 2.4.1), selected picture stay visible in thumbnail view mode even if I resize/open a panel.

Now, there's a matter if I change the thumbnail size.

In fact, I dont' understand what happens here.

For exemple, I select a 155 pictures album and I go to the end of the thumbnails list.

With 80 pixels thumbnail, I have 10 thumbnails width and 5 heights.

I select the last picture.

And now, if I enlarge thumbnail size to the max (256 pixels), digikam show me in thumbnail view absolutely not the last picture. I have 3x3 thumbnail, and it's going from 16th to 24th pictures thumbnails.

What I only would like, is Digikam always keep in view the selected picture (in case where there's only one selected picture at least and if there's Multiple selected, may be the first of the selection or the last selected).
Comment 5 Nicolas Boulesteix 2011-12-14 21:42:07 UTC
May be I have a lead.

I do the same thing with an other album with 5000 pictures, and I notice the scroll bar seems to be placed with the same proportions as with the 155 pictures album.

I do a test with an other album, same thing.

In fact, with a (around) 300 pictures album, if I go to the end of it, I have to hit six time PageUp key to go back to the begin of the album with 80 pixels thumbnails.

And with 256 pixels thumbnail, I'm not in the end of the album, but, I have to hit six time PageUp key to go back to the begin too.

I hope I'm "clear" enough...
Comment 6 Marcel Wiesweg 2011-12-25 11:30:54 UTC
I'm not quite sure I understand again. Easiest is you give a scenario to reproduce, as simple as possible (go to album with n pictures; scroll to picture x; select picture y; change thumb size from a to b) with a defined endpoint (picture z1 is visible at the top or bottom) which is not met (pciture z2 is visible instead)
Comment 7 Nicolas Boulesteix 2011-12-26 12:01:34 UTC
So, I try to be more "scenaristic"...

I go in a 507 pictures album with thumnail size set to the minimum (80 pixels).

With this set, I see 14 thumbnails in wide and 4 in heigth (56 by page).

I go to a random position and the top left thumbnail is the 225th (=56 (by page)*4 (pages) + 1 (first thumbnail of the 5th page))and i select it.

If I change thumbnail size to the maximum (256 pixels), I have 5 thumbnails wide, and almost 2 in height (10 by page).

The top left thumbnail is the 41th (=10 (by page)*4 (pages) + 1 (first thumbnail of the 5th page)).

So clearly, the offset is not properly kept, and I see here Digikam, when changing thumbnail size, keep the number of pages of thumbnail to reach position and not the thumbnail number...

If I choose another thumbnail size, exactly the same things happens :

with 144 pixels thumbnails, I have a 9x3 thumbnails page (27 by page) and the top left thumbnail is the 109th (=27 (by page)*4 (pages) + 1 (first thumbnail of the 5th page))

So, I hope this will be sufficient for you to reproduce and understand what happens.

Thanks
Comment 8 Marcel Wiesweg 2012-05-19 17:46:23 UTC
Git commit 960998210a4e5109f26546648612a31699007e1f by Marcel Wiesweg.
Committed on 19/05/2012 at 19:45.
Pushed by mwiesweg into branch 'master'.

Store and restore scroll position when changing thumbnail size

M  +2    -1    NEWS
M  +3    -2    digikam/items/imagecategorizedview.cpp

http://commits.kde.org/digikam/960998210a4e5109f26546648612a31699007e1f
Comment 9 Nicolas Boulesteix 2012-06-29 08:46:03 UTC
I've just test with Digikam 2.6 and it's works perfectly !

Thanks