show native icons in directory viewer



UI Design
17 years ago
7 years ago


(Reporter: Alec Flett, Assigned: jag (Peter Annema))



Dependency tree / graph

Firefox Tracking Flags

(Not tracked)



(1 attachment)



17 years ago
it would be really cool if we could show native icons in the directory viewer.
Turns out it's incredibly simple. Attaching a one line patch

the only confusion I'm having is how to show a folder icon...

Comment 1

17 years ago
Created attachment 33986 [details] [diff] [review]
one line fix

Comment 2

17 years ago
Does it work on Mac?  :)

Comment 3

17 years ago
don't think so... you have to figure out how to get imglib to paint native
icons, and then hook them up to the moz-icon protocol

Comment 4

17 years ago
well it's still a good start :)

Comment 5

17 years ago
Yes it works on Mac. Simon you need to try out the mailnews client =). I'm
painting native mac and windows icons in the attachment pane. 

moz-icon urls work on the Mac and on Windows. =)

Comment 6

17 years ago
Hmmm, interesting...

looks like there's a couple of slightly dodgy assumptions in there, like icons 
being 8 bit never 24, and the only possible icon sizes being 16 and 32, but all 
in all its a cool thing to have. Will file bugs on those if/when I see problems 
stemming from those assumptions. The code uses PBDTGetIcon which is supported in 
Carbon, though I wonder if some of the code would be more future proof (128x128 
icons etc) if ported to use the newer IconServices APIs?

Comment 7

17 years ago
Yes, it should use Icon Services. And instead of reading the pixels directly, I 
think it would be safer to draw to a GWorld, and convert that to an nsIImage.

Comment 8

17 years ago
Just FYI, I have patches (bug 78148) to move file:/// to html format, but they
probably won't be turned on for a while. My patches use the same icons ns4 does,
or would if they actually still worked (I'm about to file a bug on pav for that
- they did work not that long ago)

Comment 9

17 years ago
*** Bug 82687 has been marked as a duplicate of this bug. ***

Comment 10

17 years ago
xp-apps - directory viewer
Component: Networking: File → XP Apps
QA Contact: tever → sairuh


17 years ago
Priority: -- → P3
Target Milestone: --- → mozilla1.0

Comment 11

17 years ago
Alec: native Mac icon support bug is 66814 - has a patch, needs review.

I'd also repeat my comment: IconServices is a very nice modern API for doing this 
and the existing code should probably be replaced by an IconServices 
Depends on: 66814
Note that we'll be moving to html soon for all the listings, at least until this
moves to outliner. After my patch, that uses the 4.7 icons, but if someone can
give me a url I can get them to use these instead.

Comment 13

17 years ago
Bradely, as I understand it this is about showing the directory browser for local 
(file:///) URLs. So when it says "native icons" it means "the icon the file has 
on my local disk here" rather than a set of generic document icons as FTP uses. 
yes, but as of tomorrow (hopefully) file (and gopher) will follow the pref which
ftp does for whether to use xul or html for directory listings - see bug 78148
And I'd like to do this, too, if you can give me a way which will work on all

Comment 15

17 years ago
OK cool - then I think that depends which way you want to go - if you have an 
nsIImage for the icon you want to show and you need a native mac icon, then you 
need the patch I linked in the bug above.

However, I think its much more likely that you have a URL pointing to the file on 
disk you want to display the icon for? In that case I think the protocol moz-
icon: can be used to display the correct icon for the file, and you shouldn't 
have to do anything other than generate URLs in the right format.

I'm not sure what one needs to put in the URL exactly... possibly the path of a 
file on disk? From the first patch on this bug I think not.

I just tried that in yesterday's build (typing it into the URL bar on Mac OS) and 
it didn't work. So, anyone know precisely what needs to be done?

Comment 16

17 years ago
Bugs targeted at mozilla1.0 without the mozilla1.0 keyword moved to mozilla1.0.1 
(you can query for this string to delete spam or retrieve the list of bugs I've 
Target Milestone: mozilla1.0 → mozilla1.0.1


16 years ago
Target Milestone: mozilla1.0.1 → mozilla1.2alpha

Comment 17

16 years ago
this would be cool, but the directory viewer isn't even used anymore. futuring
for now, but I still think it would be neat. Hopefully someone else will take
the reins on this...
Keywords: helpwanted
Target Milestone: mozilla1.2alpha → Future
Product: Core → Mozilla Application Suite
Was this (patch) fixed/included in bug 113742 patch !?

Assignee: alecf → jag
Priority: P3 → --
QA Contact: bugzilla
Target Milestone: Future → ---

Comment 19

10 years ago
Well, I just tried it, and no native icons appear in Firefox or Camino. So if it was ever fixed then it's broken again.

Comment 20

7 years ago
WORKSFORME: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b12pre) Gecko/20110212 Firefox/4.0b12pre SeaMonkey/2.1b3pre
Last Resolved: 7 years ago
Resolution: --- → WORKSFORME

Comment 21

7 years ago
Fixed in either Bug 131393 and/or Bug 129327.
Depends on: 131393, 129327
You need to log in before you can comment on or make changes to this bug.