Bookmark icons in the Places window

Discuss application theming and theme development.
Post Reply
User avatar
ehume
Posts: 6743
Joined: November 17th, 2002, 12:33 pm
Location: Princeton, NJ, USA

Bookmark icons in the Places window

Post by ehume »

In my themes, non-favicon bookmarks show :hover and :active states. I can't seem to make that happen in the Places window.

I can get the tree rows to show a hover effect (in places.css):

Code: Select all

treechildren::-moz-tree-row(hover) {
  background-color: #C3F4FD;
}


I can get tree rows to show background changes for select and focus (tree.css):

Code: Select all

treechildren::-moz-tree-row(selected) {
  background-color: #C3F4FD;
}

treechildren::-moz-tree-row(selected, focus) {
  background-color: #82E6F9;
}


I can get my folder icon to show changes for hover and open (places.css):

Code: Select all

treechildren::-moz-tree-image(title, container) {
  list-style-image: url("chrome://global/skin/icons/folder-item.png");
  -moz-image-region: rect(0px, 48px, 24px, 24px); /* not !important */
  width: 24px;
  height: 24px;
  margin: 0px 2px;
}

treechildren::-moz-tree-image(title, open) {
  -moz-image-region: rect(24px, 48px, 48px, 24px) !important;
}

treechildren::-moz-tree-image(title, selected),
treechildren::-moz-tree-image(title, hover) {
  -moz-image-region: rect(48px, 48px, 72px, 24px); /* not !important */
}


and make livemarks and queries show hover and active (places.css):

Code: Select all

treechildren::-moz-tree-image(title, container, livemark) {
  list-style-image: url("chrome://browser/skin/livemark-item-16.png");
  -moz-image-region: rect(0px, 16px, 16px, 0px) !important;
  width: 16px;
  height: 16px;
  margin: 4px 6px;
}

treechildren::-moz-tree-image(title, container, livemark, hover) {
  -moz-image-region: rect(16px, 16px, 32px, 0px) !important;
}

treechildren::-moz-tree-image(title, container, livemark, selected) {
  -moz-image-region: rect(32px, 16px, 48px, 0px) !important;
}

treechildren::-moz-tree-image(title, container, tagContainer) {
  list-style-image: url("chrome://mozapps/skin/places/tagContainerIcon.png");
  -moz-image-region: auto;
}

/* query-nodes should be styled even if they're not expandable */
treechildren::-moz-tree-image(title, query) {
  list-style-image: url("chrome://browser/skin/24x3.png");
  -moz-image-region: rect(0px 72px 24px 48px) !important;
}

treechildren::-moz-tree-image(hover, title, query) {
  -moz-image-region: rect(24px 72px 48px 48px) !important;
}

treechildren::-moz-tree-image(selected, title, query) {
  -moz-image-region: rect(48px 72px 72px 48px) !important;
}


But I haven't been able to get anything like treechildren::-moz-tree-image(title) to show any image except one static, single-element graphic.

Does anyone have any thoughts?
Firefox: Sic transit gloria mundi.
User avatar
mcdavis
Posts: 3195
Joined: December 9th, 2005, 5:51 am

Post by mcdavis »

Could I ask which nightly you're testing against, and whether your code is downloadable?
Theme Development is Radical Participation.
NNL Beta Builds for Current and Up-coming Firefox
Dear User: Your Help is Needed
User avatar
ehume
Posts: 6743
Joined: November 17th, 2002, 12:33 pm
Location: Princeton, NJ, USA

Post by ehume »

The above was tested against yesterday's nightly (I no longer test against hourlies as I did in the past).

As for code, "mi code, su code." Let me know if you'd like a whole file, or the whole theme.
Firefox: Sic transit gloria mundi.
User avatar
mcdavis
Posts: 3195
Joined: December 9th, 2005, 5:51 am

Post by mcdavis »

Hourlies. Whew! That'll keep a person busy.

Whole theme, please.

I also just released one of mine on AMO, which you're of course welcome to look at.
Theme Development is Radical Participation.
NNL Beta Builds for Current and Up-coming Firefox
Dear User: Your Help is Needed
User avatar
ehume
Posts: 6743
Joined: November 17th, 2002, 12:33 pm
Location: Princeton, NJ, USA

Post by ehume »

Firefox: Sic transit gloria mundi.
User avatar
mcdavis
Posts: 3195
Joined: December 9th, 2005, 5:51 am

Post by mcdavis »

Code: Select all

  -moz-image-region: rect(0px, 48px, 24px, 24px); /* not !important */


Thank you for that. I was wondering what the problem was there. :)
Theme Development is Radical Participation.
NNL Beta Builds for Current and Up-coming Firefox
Dear User: Your Help is Needed
User avatar
mcdavis
Posts: 3195
Joined: December 9th, 2005, 5:51 am

Post by mcdavis »

Are these (marked in magenta) the non-favicon bookmarks that you're trying to style?

Image

I can't get them to respond either.

Maybe you've already fixed this by now.
Theme Development is Radical Participation.
NNL Beta Builds for Current and Up-coming Firefox
Dear User: Your Help is Needed
User avatar
ehume
Posts: 6743
Joined: November 17th, 2002, 12:33 pm
Location: Princeton, NJ, USA

Post by ehume »

mcdavis941 wrote:Are these (marked in magenta) the non-favicon bookmarks that you're trying to style?

Image

I can't get them to respond either.

Maybe you've already fixed this by now.


Those are indeed the items I have tried to style. I have not fixed it. I think it is hard-coded. Unfortunately, I made several identical files to make the current style, and I don't remember what file goes to that. I suppose I could swap out my various image files until I found out which one it is. But until I can make that icon do something, it's too much trouble.
Firefox: Sic transit gloria mundi.
User avatar
ehume
Posts: 6743
Joined: November 17th, 2002, 12:33 pm
Location: Princeton, NJ, USA

Post by ehume »

mcdavis941 wrote:

Code: Select all

  -moz-image-region: rect(0px, 48px, 24px, 24px); /* not !important */


That comment was to keep myself from ever making it !important. In the past, some ill-thought-out !important flags have caused me enormous trouble.
Firefox: Sic transit gloria mundi.
User avatar
ehume
Posts: 6743
Joined: November 17th, 2002, 12:33 pm
Location: Princeton, NJ, USA

Post by ehume »

ehume wrote:
mcdavis941 wrote:Are these (marked in magenta) the non-favicon bookmarks that you're trying to style?

Image

I can't get them to respond either.

Maybe you've already fixed this by now.


Those are indeed the items I have tried to style. I have not fixed it. I think it is hard-coded. Unfortunately, I made several identical files to make the current style, and I don't remember what file goes to that. I suppose I could swap out my various image files until I found out which one it is. But until I can make that icon do something, it's too much trouble.


Actually, it was no trouble at all. The file is mozapps/places/defaultFavicon.png.

And, from LXR:

Code: Select all

http://lxr.mozilla.org/mozilla/source/toolkit/components/places/src/nsFaviconService.h#128

#define FAVICON_DEFAULT_URL "chrome://mozapps/skin/places/defaultFavicon.png"
Firefox: Sic transit gloria mundi.
Post Reply