Bug 287211 - File in Last row of Dolphin Icon view cannot show the full name
Summary: File in Last row of Dolphin Icon view cannot show the full name
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 1.99
Platform: Chakra Linux
: NOR normal
Target Milestone: ---
Assignee: Peter Penz
URL:
Keywords: investigated, reproducible
Depends on:
Blocks:
 
Reported: 2011-11-21 23:46 UTC by Weng Xuetian
Modified: 2011-12-05 19:01 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 4.8.0


Attachments
Screenshot (18.04 KB, image/png)
2011-11-21 23:46 UTC, Weng Xuetian
Details
Patch (1.92 KB, patch)
2011-12-05 08:30 UTC, Frank Reininghaus
Details
The right patch (1.58 KB, patch)
2011-12-05 08:32 UTC, Frank Reininghaus
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Weng Xuetian 2011-11-21 23:46:14 UTC
Version:           1.99 (using Devel) 
OS:                Linux

It seems that dolphin's scroll area just think the last row of Icon has only one line of text in file name.

Reproducible: Sometimes

Steps to Reproduce:
1. Open a folder with a lot of file that need a scroll bar
2. Scroll to the bottom

Actual Results:  
Last row can be shown completely

Expected Results:  
Last row can be shown with only one line text.

It's only happen in some case but not others..
Comment 1 Weng Xuetian 2011-11-21 23:46:47 UTC
Created attachment 65918 [details]
Screenshot
Comment 2 Frank Reininghaus 2011-12-05 08:20:59 UTC
Thanks for the bug report! I can confirm this in master.

Note that it does show the full names for all items in the last row if the very last file in the view is the one with the longest name. The problem seems to be that KItemListViewLayouter::doLayout() sets 

m_maximumScrollOffset = m_itemRects.last().bottom(),

which is not necessarily the real maximum scroll offset. It should calculate the maximum of the bottom() for all itemRects in the last row.
Comment 3 Frank Reininghaus 2011-12-05 08:30:34 UTC
Created attachment 66389 [details]
Patch

This patch fixes it for me, but it might go wrong if grouping is enabled...
Comment 4 Frank Reininghaus 2011-12-05 08:32:40 UTC
Created attachment 66390 [details]
The right patch

Sorry, I clicked the wrong patch file. This should be the right patch now, but as I said, I'm not sure if it works well with grouping.
Comment 5 Peter Penz 2011-12-05 09:08:52 UTC
Thanks Frank for the patch! As you guessed there will be minor issues on some corner-cases when grouping is turned on: E.g. assuming that each group only contains one item (except the last that contains e.g. 2) although we have 5 columns then 'index' will be too large.

I've an idea how to fix this based on your patch and will test + push it ~tomorrow :-)
Comment 6 Peter Penz 2011-12-05 19:01:40 UTC
Git commit b1d75b49e2dea4a91a76be6d9e9251bba6826d36 by Peter Penz.
Committed on 05/12/2011 at 19:56.
Pushed by ppenz into branch 'master'.

Fix calculation of maximum scroll offset

The maximum scroll offset must be the maximum y-range of the last
row, not only the maximum of the last item.

Thanks to Frank Reininghaus for analysing the root-cause and
for providing the initial patch!

BUG: 287211
FIXED-IN: 4.8.0

M  +9    -0    dolphin/src/kitemviews/kitemlistviewlayouter.cpp

http://commits.kde.org/kde-baseapps/b1d75b49e2dea4a91a76be6d9e9251bba6826d36