Custom folder icons in Firefox Bookmark Manager

Discuss application theming and theme development.
Post Reply
Scipio
Posts: 188
Joined: August 21st, 2006, 6:17 pm
Location: New York

Custom folder icons in Firefox Bookmark Manager

Post by Scipio »

I've given a few of my Bookmark folders custom icons to locate them better, but they don't show in either Bookmark Manager or the sidebar. I've tried adding code to UserChrome and just can't seem to get them to show. This attempt added the custom icon to every line in the Location and Description columns (colorful, but not what I wanted) but I can't seem to get it to target the folder.

Code: Select all

#bookmarks-view treechildren, #bookmark-item[container="true"][label="Motels"] {
  list-style-image: url('file://C:/Icons/Folder[P].ico') !important;
  -moz-image-region: rect(0px 16px 16px 0px) !important;
}

I would appreciate any help.
User avatar
CatThief
Posts: 1854
Joined: January 19th, 2004, 12:19 am
Location: Northeast USA

Post by CatThief »

I, too, am interested in knowing if this is possible to do. In testing, the only folders I am able to affect are inside the bookmarks toolbar with this:

Code: Select all

.bookmark-item[container="true"][label="Motels"] {
  list-style-image: url("some-image.png") !important;
}

Treechildren, however, are proving to be more difficult. This code along with similar variations won't work:

Code: Select all

treechildren::-moz-tree-image(name-Motels, container) {
  list-style-image: url("someimage.png") !important;
}
Still passionate for Mozilla themes and extensions, just not actively developing them for public release anymore.
Scipio
Posts: 188
Joined: August 21st, 2006, 6:17 pm
Location: New York

Post by Scipio »

CatThief wrote:Treechildren, however, are proving to be more difficult. This code along with similar variations won't work:

Code: Select all

treechildren::-moz-tree-image(name-Motels, container) {
  list-style-image: url("someimage.png") !important;
}


More difficult is an understatement. I've gone through the Bookmarks Manager xul and css files trying to get some insight into how the default icon is assigned, but have had no luck. I know it's possible to affect the sidebar and manager as custom icons assigned to bookmarks will show up, but the container folders have me stumped for the moment.
After several hundred tries, any ideas or suggestions will be very welcome.
User avatar
Raila
Posts: 524
Joined: January 21st, 2005, 2:02 pm
Location: huh? Where? WHEN?!? OH! Indiana
Contact:

Post by Raila »

Im not sure if Im reading you right, but I have mine changed with a personal choice of icon for each of about 10 different ones in the Folder, the Sidebar and they work fine.

Code: Select all


* Change Bookmark Toolbar Folder Icons */
#personal-bookmarks toolbarbutton[label="Icons"] {padding: 0px 0px 0px 0px !important;}
#personal-bookmarks toolbarbutton[label="Icons"] .toolbarbutton-icon {display: block !important; list-style-image: url('file:///F:/pics/FavIcons/Yingyang1.ico') !important; -moz-image-region: auto !important; margin: 0px 2px 0px 2px !important;}
#personal-bookmarks toolbarbutton[label="Icons"] .toolbarbutton-text {display: none !important;}



of course Im tired so I could be totally seeing something utterly different than what you want...
i5 2500 running Win 7
Vanilla Fx (for now)
Extensions-TabMixPlus, IETab2, FireGestures, Stylish, AdblockPlus 2, ColorfulTabs
Scipio
Posts: 188
Joined: August 21st, 2006, 6:17 pm
Location: New York

Post by Scipio »

Thank you for the input Raila, but that code only changes the icon on the toolbar and not the sidebar.
What I'm trying to do is get the custom icon I've assigned to Bookmark Folders to also show up in the Bookmark Manager and Sidebar.
For example, the code I posted assigns, in the Bookmarks drop down menu, a bright purple folder icon to the Folder "Motels" where I keep bookmarks for various lodging. However, in the Bookmarks Manager, it's only the generic folder icon rather than my custom icon.
If you use Favicon Picker to give a Bookmark a custom icon, it shows in the BM and Sidebar so it seems that it should be possible with Folders but so far it's eluding me.
User avatar
CatThief
Posts: 1854
Joined: January 19th, 2004, 12:19 am
Location: Northeast USA

Post by CatThief »

@Scipio, I think I may have a "treechildren" solution. Take a look at this thread where I posted a solution to a similar issue:
http://forums.mozillazine.org/viewtopic.php?t=566896
Still passionate for Mozilla themes and extensions, just not actively developing them for public release anymore.
User avatar
Raila
Posts: 524
Joined: January 21st, 2005, 2:02 pm
Location: huh? Where? WHEN?!? OH! Indiana
Contact:

Post by Raila »

hm, as I have never used the Sidebar, lol I never paid attention to that!! Sorry guys!
i5 2500 running Win 7
Vanilla Fx (for now)
Extensions-TabMixPlus, IETab2, FireGestures, Stylish, AdblockPlus 2, ColorfulTabs
SkyPilot
Posts: 2175
Joined: August 9th, 2004, 1:18 am

Post by SkyPilot »

I use this code to hide the folder icons in the sidebar and BM:

Code: Select all

#bookmarks-view treechildren::-moz-tree-image(Name, container) {
  list-style-image: none !important;
}

So it should work to change the folder icon. Maybe something like this:

Code: Select all

#bookmarks-view treechildren::-moz-tree-image(Name-Motels, container) {
  list-style-image: url("someimage.png") !important;
}
User avatar
CatThief
Posts: 1854
Joined: January 19th, 2004, 12:19 am
Location: Northeast USA

Post by CatThief »

SkyPilot wrote:So it should work to change the folder icon. Maybe something like this:

Code: Select all

#bookmarks-view treechildren::-moz-tree-image(Name-Motels, container) {
  list-style-image: url("someimage.png") !important;
}

In Tb, in order to make the names of user accounts inside the folder pane tree available, this code needs to be applied:

Code: Select all

with (document.getElementById("folderNameCell"))
   setAttribute("properties", getAttribute("properties") + " name-?folderTreeName")

It seems that a similar thing is needed in Fx in order for the userChrome code to work.
Still passionate for Mozilla themes and extensions, just not actively developing them for public release anymore.
Scipio
Posts: 188
Joined: August 21st, 2006, 6:17 pm
Location: New York

Post by Scipio »

Well, I'm getting nowhere with this. So far the JS script doesn't make a difference. ](*,)
When I have time I'm going to tear Favicon Picker apart to see if I can figure out how it sets the Bookmark Icons that show in the Bookmark Manager.
I tried this and liked the effect, so I guess it's not a total loss.

Code: Select all

.bookmark-item[container='true'][label='your folder name'], #treechildren::-moz-tree-image(folderNameCol, name-your folder name)
  {list-style-image: url("file://Path to icon") !important;}

It sets the icon for the folder and makes it dissappear when hovered on.
Post Reply