Bug 172746 - Application and emote icons in folder icon selector are cut off
Summary: Application and emote icons in folder icon selector are cut off
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 16.12.2
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Simon St James
URL:
Keywords:
: 168458 172765 174440 177029 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-10-13 20:42 UTC by Jonathan Thomas
Modified: 2008-12-10 23:54 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Screenshot showing the bug (77.24 KB, image/png)
2008-10-13 20:42 UTC, Jonathan Thomas
Details
Candidate patch for this issue (5.79 KB, patch)
2008-10-18 15:09 UTC, Simon St James
Details
Updated patch (7.04 KB, patch)
2008-12-10 22:17 UTC, Simon St James
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Thomas 2008-10-13 20:42:08 UTC
Version:           1.1 (using 4.1.2 (KDE 4.1.2), Kubuntu packages)
Compiler:          cc
OS:                Linux (i686) release 2.6.26-5-generic

Originally reported at https://launchpad.net/bugs/282474

To reproduce, right click on any folder in Dolphin and go to the folder properties. Click on the folder icon to open up the icon selector. The icons in the "Applications" and "Emotes" categories are cut weirdly. I will attach a screenshot shortly.
Comment 1 Jonathan Thomas 2008-10-13 20:42:44 UTC
Created attachment 27860 [details]
Screenshot showing the bug
Comment 2 bakthariq 2008-10-14 07:06:49 UTC
*** Bug 172765 has been marked as a duplicate of this bug. ***
Comment 3 Simon St James 2008-10-14 20:45:04 UTC
This isn't a Dolphin bug - it occurs in kdelibs/kio/file/kicondialog.cpp - or thereabouts :) I'll take a quick look now ...
Comment 4 Simon St James 2008-10-15 09:58:17 UTC
The problem seems to occur because the KIconCanvas is set to have uniformItemSizes, whereas the icons it has in it are one of the stock icon sizes from the pre-rendered PNG icons (16,32,48, etc - all 48 by default) and a hard-coded size of 60 for the SVG icons, like the AIM etc icons.

I'm not sure how best to fix this, though - a start would be to get this hard-coded value of 60 removed and made adjustable (I'll do this tonight) and then find a means of finding the sizes of the non-scalable icons and scaling the SVGs to match.

About the text-clipping - this seems to be a rather odd decision by TT - in the text is only allowed to be as wide as the icon, even if the space between icons permits much more.  In KDE3, the text was allotted more space.  I don't know if this is configurable somehow or whether it would require a new delegate to be written.
Comment 5 Simon St James 2008-10-18 15:09:26 UTC
Created attachment 27995 [details]
Candidate patch for this issue

Patch that:

1) Generalises some stuff and removes some magic numbers;

2) Assures that uniformIconSizes is honoured by adding padding to images that are too small;

3) Attempts to ensure that the speed/ memory impact of 2) is minimized and also that SVGs are scaled to a size consistent with the other icons;

4) Allots more horizontal space for the icon name - this is now dependent on the grid size, so if you feel it is still too cramped, the grid size should be enlarged.  I'll leave that decision up to someone with a better sense of aesthetics than me :)

CC'ing Carsten as he's the most active guy with his name in the file ;)
Comment 6 Dario Andres 2008-11-30 13:09:49 UTC
Bug 168458 and bug 174440 are duplicate of this bug.
Comment 7 Simon St James 2008-11-30 13:18:09 UTC
*** Bug 168458 has been marked as a duplicate of this bug. ***
Comment 8 Simon St James 2008-11-30 13:19:35 UTC
*** Bug 174440 has been marked as a duplicate of this bug. ***
Comment 9 Pino Toscano 2008-12-06 11:14:20 UTC
*** Bug 177029 has been marked as a duplicate of this bug. ***
Comment 10 Eduardo Durany Fernández 2008-12-10 01:06:38 UTC
It seems fixed in kde 4.2 beta 1
Comment 11 Dario Andres 2008-12-10 01:41:55 UTC
Mh, I can still reproduce it with today 4.2 svn build. (But it happens when selecting icons for a "Places" item (like in Dolphin Places panel), This bug doesn't appear when selecting an icon for a folder inside a Plasma FolderView plasmoid.

(Also when selecting an icon for a "Places" item, inside Dolphin Places panel , the "System Icons:" combobox (to select an icon category) is empty, and only "applications" category icons are displayed, but this may be another bug)
Comment 12 Frederik Schwarzer 2008-12-10 01:49:06 UTC
Just type
kdialog --geticon action
in a terminal and you get a dialog where som icons are broken and where the buttons on the upper right do not expand with the text on it (i.e. translated messages are cut off if longer than the original text).
Comment 13 Eduardo Durany Fernández 2008-12-10 02:04:42 UTC
Ok, you are right. I only checked the bug description instructions. 
Comment 14 Simon St James 2008-12-10 11:35:24 UTC
@Dario,

If you're building from SVN, can you test out my patch? If it works OK, I'll commit shortly.  You can play with the setGridSize(QSize(80,80)) size to increase the amount of text shown.
Comment 15 Simon St James 2008-12-10 22:17:43 UTC
Created attachment 29224 [details]
Updated patch

Heh - the way of dealing with Groups vs explicit sizes with KIconLoader stuff is very confusing indeed :)

Dario has found that the old patch caused big problems when kdialog -geticon was called with incorrect parameters (you can find the set of supported parameters in here: http://websvn.kde.org/trunk/KDE/kdebase/apps/kdialog/kdialog.cpp?view=markup), so I've fixed this too as we should handle malformed input gracefully.

If people can test this new patch and if it doesn't cause any more problems, I'll commit.

Thanks!
Comment 16 Simon St James 2008-12-10 23:54:06 UTC
SVN commit 895536 by sstjames:

Magic numbers--, pad icons to respect uniformItemSizes, choose appropriate size to reduce need for padding and ensure SVGs are scaled to a matching size, add delegate so that more space is allocated for text, increase grid (thus, text) size and initial dialog size.

BUG:172746

 M  +112 -10   kicondialog.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=895536