MozillaZine

Bookmark icons in the Places window

Discuss application theming and theme development.
ehume

User avatar
 
Posts: 6712
Joined: November 17th, 2002, 12:33 pm
Location: Princeton, NJ, USA

Post Posted December 8th, 2007, 10:53 am

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.

mcdavis

User avatar
 
Posts: 3029
Joined: December 9th, 2005, 5:51 am

Post Posted December 8th, 2007, 5:25 pm

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

ehume

User avatar
 
Posts: 6712
Joined: November 17th, 2002, 12:33 pm
Location: Princeton, NJ, USA

Post Posted December 8th, 2007, 7:06 pm

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.

mcdavis

User avatar
 
Posts: 3029
Joined: December 9th, 2005, 5:51 am

Post Posted December 8th, 2007, 7:23 pm

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

ehume

User avatar
 
Posts: 6712
Joined: November 17th, 2002, 12:33 pm
Location: Princeton, NJ, USA

Post Posted December 9th, 2007, 11:39 am

Firefox: Sic transit gloria mundi.

mcdavis

User avatar
 
Posts: 3029
Joined: December 9th, 2005, 5:51 am

Post Posted December 11th, 2007, 11:52 pm

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

mcdavis

User avatar
 
Posts: 3029
Joined: December 9th, 2005, 5:51 am

Post Posted December 12th, 2007, 1:54 am

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

ehume

User avatar
 
Posts: 6712
Joined: November 17th, 2002, 12:33 pm
Location: Princeton, NJ, USA

Post Posted December 12th, 2007, 8:05 pm

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.

ehume

User avatar
 
Posts: 6712
Joined: November 17th, 2002, 12:33 pm
Location: Princeton, NJ, USA

Post Posted December 12th, 2007, 8:10 pm

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.

ehume

User avatar
 
Posts: 6712
Joined: November 17th, 2002, 12:33 pm
Location: Princeton, NJ, USA

Post Posted December 12th, 2007, 8:43 pm

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.

Return to Theme Development


Who is online

Users browsing this forum: No registered users and 0 guests