Review Request: Fix for Bug 302624 - The size of the rating stars in icons mode depends on the length of the file name
Emmanuel Pescosta
emmanuelpescosta099 at gmail.com
Sat Aug 4 10:07:07 BST 2012
> On Aug. 4, 2012, 6:43 a.m., Frank Reininghaus wrote:
> > Thanks for the patch! Very nice fix, looks good! Just one little question: when I first looked at your patch, I thought that the change in KStandardItemListWidget::updateTextsCache() (replacing m_textRect.width() by size().width()) could be sufficient to fix this issue. Could you comment briefly on why the other two code changes are necessary as well?
1032 } else if (role == "rating") { // If role is Rating use width from Rating-Pixmap, because Rating-Text is empty.
1033 requiredWidth = m_rating.width();
1032 }
# Problem: When you select a file with a file name "a" and activate the rating starts, the overlay width is set to the file name width (in px). => So not all rating stars are in the overlay (looks ugly).
# Fix: When you select a file or folder, the information under the icon has a background overlay and the size of this overlay (width) was determined by the maximum text width (in px) of all additional informations + file/dir name. But the rating stars have no text, so the width was 0px -> So instead of the text width we use the pixmap width to calculate the maximum width.
# Result: If the rating star pixmap has the greatest width of all informations, use it for the overlay width.
The rating stars were not really centered (+2px right), so we can fix it with -2px left.
pos.rx() += (size().width() - m_rating.width()) / 2 - 2;
- Emmanuel
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/105830/#review16845
-----------------------------------------------------------
On Aug. 2, 2012, 6:43 p.m., Emmanuel Pescosta wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/105830/
> -----------------------------------------------------------
>
> (Updated Aug. 2, 2012, 6:43 p.m.)
>
>
> Review request for Dolphin and Frank Reininghaus.
>
>
> Description
> -------
>
> Fixes the size of the rating stars for short and long file names in icons and compact view mode.
>
>
> This addresses bug 302624.
> http://bugs.kde.org/show_bug.cgi?id=302624
>
>
> Diffs
> -----
>
> dolphin/src/kitemviews/kstandarditemlistwidget.cpp 9cdb60e
>
> Diff: http://git.reviewboard.kde.org/r/105830/diff/
>
>
> Testing
> -------
>
>
> Screenshots
> -----------
>
> Fixed and Unfixed Dolphin Version
> http://git.reviewboard.kde.org/r/105830/s/661/
>
>
> Thanks,
>
> Emmanuel Pescosta
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20120804/a1f5a375/attachment.htm>
More information about the kfm-devel
mailing list