Themes rejected.. window controls and titlebar theming.

Discuss application theming and theme development.
User avatar
jivko
Posts: 237
Joined: September 2nd, 2008, 11:20 am

Re: Themes rejected.. missing window controls 4.0b1, Win7

Post by jivko »

akayser wrote:This is what I have:

Code: Select all

/* For Glass, we need to do this */
@media all and (-moz-windows-compositor)
{
#titlebar-buttonbox{display:none}
#main-window #titlebar{
   border-bottom:0!important;
   padding-bottom:2px!important;
   background-image:url(chrome://global/skin/hout-hover.png);
   -moz-box-shadow:none!important;
   margin-bottom:0!important}
#main-window[chromemargin]{
   -moz-appearance:-moz-win-borderless-glass;
   background:transparent}
#main-window[chromemargin]:not(:-moz-lwtheme)[inFullscreen="true"]{
   -moz-appearance:none;
   background-image:url(chrome://global/skin/hout.png)}
#tab-view-deck{
   margin-top:0!important;
   background-image:url(chrome://global/skin/hout.png)}
#TabsToolbar[tabsontop="true"]{
   margin:0!important}
#appmenu-button[type]{
   margin-top:3px!important;
   margin-bottom:0!important}
#tab-view{
   border-top:2px solid;
   -moz-border-top-colors: #B36F00 #EED4A2}   
}


The minimum is:

Code: Select all

@media all and (-moz-windows-compositor)
{
#titlebar-buttonbox{display:none}
#main-window[chromemargin]{
   -moz-appearance:-moz-win-borderless-glass;
   background:transparent}
#main-window[chromemargin]:not(:-moz-lwtheme)[inFullscreen="true"]{
   -moz-appearance:none}
}

The trick is to apply -moz-win-borderless-glass and transparent background to the main-window, but only for FF4, so [chromemargin] is used to for that. And to hide the titlebar-buttonbox, as noticed before.
To prevent to everything becomes transparent/glass, one needs to specify background color/image on tab-view-deck (which is also FF4 only).


I must paste this in the browser.css document right?I have Xp and I can't see this stupid bug and unfortunately 2 reviewers blamed me for uploading a broken theme. They both tested it on 7.Here's what they showed me. http://img193.imageshack.us/img193/4938 ... hotefg.png
User avatar
Zigboom
Posts: 475
Joined: April 22nd, 2009, 5:09 am

Re: Themes rejected.. missing window controls 4.0b1, Win7

Post by Zigboom »

Hi jivko,

Yes, paste the minimum version of the code in browser.css, (sorry I cannot test it for you, I'm also on XP).
To test you'll need a machine that runs Aero, not just Win 7, Vista with Aero effects is also OK. So a virtual machine won't help. Hope you'll find someone that can test it for you, otherwise I suggest to paste the code and take the chance, it should work.
I had the same problem and this code solved it, thanks akayser for sharing!
-=# LavaFox & Black Fox - Dark & hot themes for Firefox #=-
https://addons.mozilla.org/en-US/firefox/user/4710003/
User avatar
jivko
Posts: 237
Joined: September 2nd, 2008, 11:20 am

Re: Themes rejected.. missing window controls 4.0b1, Win7

Post by jivko »

Thank you all especially you mr. akayser .I'll add your names in my theme description if this works :)
User avatar
Zigboom
Posts: 475
Joined: April 22nd, 2009, 5:09 am

Re: Themes rejected.. missing window controls 4.0b1, Win7

Post by Zigboom »

You're welcome! Good luck!
-=# LavaFox & Black Fox - Dark & hot themes for Firefox #=-
https://addons.mozilla.org/en-US/firefox/user/4710003/
User avatar
jivko
Posts: 237
Joined: September 2nd, 2008, 11:20 am

Re: Themes rejected.. missing window controls 4.0b1, Win7

Post by jivko »

Theme approved.Thanks a lot akayser ,Zigboom,mcdavis and patrickjdempsey :)
User avatar
patrickjdempsey
Posts: 23686
Joined: October 23rd, 2008, 11:43 am
Location: Asheville NC
Contact:

Re: Themes rejected.. missing window controls 4.0b1, Win7

Post by patrickjdempsey »

Good to know, thanks for the info.
Tip of the day: If it has "toolbar" in the name, it's crap.
What my avatar is about: https://addons.mozilla.org/en-US/seamonkey/addon/sea-fox/
User avatar
Zigboom
Posts: 475
Joined: April 22nd, 2009, 5:09 am

Re: Themes rejected.. missing window controls 4.0b1, Win7

Post by Zigboom »

Hey, that's great to hear! You're welcome!
-=# LavaFox & Black Fox - Dark & hot themes for Firefox #=-
https://addons.mozilla.org/en-US/firefox/user/4710003/
User avatar
mcdavis
Posts: 3195
Joined: December 9th, 2005, 5:51 am

Re: Themes rejected.. missing window controls 4.0b1, Win7

Post by mcdavis »

Has anyone tried styling the window caption buttons (minimize, maximize, restore, close) on MS Windows using only -moz-appearance: none? If so, how did that work out? I think on Vista/W7 with glass, you would still get a little glow on hover, outside and above the frame, but how did it work other than that?
Theme Development is Radical Participation.
NNL Beta Builds for Current and Up-coming Firefox
Dear User: Your Help is Needed
User avatar
Paenglab
Posts: 206
Joined: December 30th, 2006, 2:20 am
Location: Switzerland

Re: Themes rejected.. missing window controls 4.0b1, Win7

Post by Paenglab »

My theme is using it's own buttons except for glass.

Under glass you can't use the transparent titlebar with own button styles. Also when the titlebar has a styled background and your using your own buttons, the click areas are still used from the aero buttons. This means, when you're using small buttons (f. ex. 16*16px) then the maximize button is in the area of the wide glass close button and pressing maximize will close FF.
Nuvola theme for Firefox and Thunderbird
User avatar
patrickjdempsey
Posts: 23686
Joined: October 23rd, 2008, 11:43 am
Location: Asheville NC
Contact:

Re: Themes rejected.. missing window controls 4.0b1, Win7

Post by patrickjdempsey »

I know this isn't exactly on-topic for this thread, but I figured it was the best place to put it since this discussion deals with the titlebar. I've been playing around with styling the titlebar for my Mosaic-Fox theme and I've come up with something sorta cool. If you leave the #titlebar styled in the OS style and then colorize #titlebar-content with a little top margin, you get the really nice effect of the OS window border appearing to wrap all the way around your custom background. You can pop the following code into userChrome or Stylish to get a sample:

Code: Select all

#titlebar {
-moz-appearance: -moz-window-titlebar !important;
}

#titlebar-content {
margin-top: 4px !important;
background-color: ActiveCaption !important;
-moz-border-radius-topright: 6px !important;
-moz-border-radius-topleft: 6px !important;
}


I thought you might find this especially useful mcdavis since NNL dark title extends all the way to the top. Obviously, you should use the :-moz-system-metric(windows-classic) selector to detect the classic theme to give the top corners 0 radius. You probably also want to use a selector and a different color for the inactive state (when other windows have focus). Has anyone played with using binding to force chromemargin: 0,-1,-1,-1 on the #main-window to always hide the native title and show the custom title?
Tip of the day: If it has "toolbar" in the name, it's crap.
What my avatar is about: https://addons.mozilla.org/en-US/seamonkey/addon/sea-fox/
User avatar
mcdavis
Posts: 3195
Joined: December 9th, 2005, 5:51 am

Re: Themes rejected.. missing window controls 4.0b1, Win7

Post by mcdavis »

patrickjdempsey wrote:I thought you might find this especially useful mcdavis since NNL dark title extends all the way to the top. Obviously, you should use the :-moz-system-metric(windows-classic) selector to detect the classic theme to give the top corners 0 radius. You probably also want to use a selector and a different color for the inactive state (when other windows have focus).


Thanks Patrick, I'll try that out.

Has anyone played with using binding to force chromemargin: 0,-1,-1,-1 on the #main-window to always hide the native title and show the custom title?


Not with a binding. I've played with manually setting chromemargin with DOM Inspector, but it didn't really work out. I had the impression that it was a problem to add it after the window was already created (a problem with the sequence of what happens when) so a binding just might do it.

I'm really hoping we have a chance (post-Fx4) to make the rest of the window frame go away.

I still have a lot of questions about how all this works with WindowBlinds and other third-party desktop themes, since I haven't looked at that at all, but it's probably a common use case since people who want to theme their browser probably want to theme their desktop too.
Theme Development is Radical Participation.
NNL Beta Builds for Current and Up-coming Firefox
Dear User: Your Help is Needed
User avatar
patrickjdempsey
Posts: 23686
Joined: October 23rd, 2008, 11:43 am
Location: Asheville NC
Contact:

Re: Themes rejected.. window controls and titlebar theming.

Post by patrickjdempsey »

Yeah, I'm betting the same thing. However I think people who are REALLY into all of that custom stuff will be late-comers to 4.0 because they will no-doubt be waiting for their favorite extensions to be updated. I have several friends who didn't move up to 3.6 until the fall because of that. So it's dicey... unless you have some specific testers who can give you direct feedback on it. Here lately though I've gotten exactly zero feedback on my themes so I don't know what to think. I'm probably just going to continue support for the ones that I use and let the others go.
Tip of the day: If it has "toolbar" in the name, it's crap.
What my avatar is about: https://addons.mozilla.org/en-US/seamonkey/addon/sea-fox/
User avatar
mcdavis
Posts: 3195
Joined: December 9th, 2005, 5:51 am

Re: Themes rejected.. window controls and titlebar theming.

Post by mcdavis »

ShareBird wrote:mcdavis, I'm wondering why you don't use anymore the native approach you used to... I've got inspiration on you (many thanks ;-)) and made my themes go with native titlebar without problems....


I changed because I finally read through all the titlebar bugs, in order, and realized some things I hadn't known before. Those are:

1. using visibility:hidden and visibility:visible on #titlebar and #titlebar-content to get the top window frame border on glass with a persona
2. the fact that native -moz-appearance on #titlebar-buttonbox doesn't work for glass cases unless #main-window has -moz-win-glass or -moz-win-borderless-glass
3. the exact cases in which -moz-appearance on titlebar sets padding-top on #titlebar. (I basically bit the big bullet and went through all the cases one by one and used DOM Inspector to see for myself. That sucked.)
4. the exact value of -moz-appearance used on elements in titlebar in all cases.

I'm sure you can diff things, but basically what I changed is:
- now I'm using -moz-appearance:-moz-window-titlebar and -moz-window-titlebar-maximized with #titlebar in all mswindows cases (all, other than F11-fullscreen), where before I was using -moz-appearance:none
- instead of leaving the titlebar looking native (on glass, and on vista basic when maximized), I'm using visibility:hidden on #titlebar to let the background show through even though I'm using a native -moz-appearance
- I'd never really gotten clear about what top and bottom margins to use on elements in the titlebar, but I wanted to control the height of the Firefox button (and give it the same height as with the def theme in most cases), so I paid close attention to that and made changes. I would be doing it exactly the same as in the def theme except they use a 2px border-bottom on the app button in some cases, but I always use a 1px border-bottom, so I had to increase the bottom margin to compensate for that difference.
- now using display:none in the glass case only on all the individual window caption buttons (.titlebar-button), since the OS draws the caption buttons in the glass case and the XUL elements should be hidden since they're not needed and to keep them from making #titlebar-buttonbox any bigger and making the transparency mask too big

Firefox uses visibility:hidden/visibility:visible on #titlebar/#titlebar-content whenever it wants to keep the size and position while letting the window background show through, which for them is only on glass and only with a persona. However, I want to show my background whether I'm using a persona or not, so I use visibility:hidden/visibility:visible in more cases.

Before, for glass, I was moving my window background lower down so it didn't cover the titlebar amd just letting glass show through, because my background was covering up the caption buttons (in the glass case only). Now I'm correctly setting -moz-appearance: -moz-window-buttonbox/-moz-window-buttonbox-maximized on #titlebar-buttonbox, which makes masking out the background over those buttons work right. So, because people are using NNL because it's a dark theme, and because I now know how to use #titlebar-content to create a window top frame border, it made sense to move the window background origin back up to the top edge of the window. And, I decided to do this for glass only, and not for any of the other desktop theme cases, because in those other cases the difference would be too great between my window background color and the frame color (like Luna's electric blue frame or Vista Basic's powder blue).

Just to recap: the difference between glass (Vista Aero) and all the other cases is that with glass the window captions button are drawn by the OS, they're always drawn, and they're layered *behind* #main-window and all the rest of browser chrome. This means that with glass you have to use the right -moz-appearance settings on #main-window and #titlebar-buttonbox so that Firefox core code knows what part of the browser chrome to make transparent so that the OS-drawn window caption buttons show through from behind. In contrast, with cases other than glass, the caption buttons are normal XUL elements and are layered normally, in front of #main-window.

My old code was written before I'd really gotten clear about Firefox setting a padding-top on #titlebar in core code. Firefox changed its approach to start doing that at some point, where before they were doing it with margins and padding in theme CSS. So, I had to change to get in line with the new approach.

The thing that makes this hard is the -moz-appearance values for things in the titlebar. I still don't fully understand those. They're setting size, position and visible style in different ways in different cases. Without some kind of summary explanation (which I haven't seen, but which would be really great), you have to not only read through the C++ code in nsWindow.cpp and friends but also understand what's happening inside the OS in response to that code. Or, make sure you know what all the cases are, then create them, then use DOM Inspector to see what's happening in each of those cases. Way way way too time-consuming.

Or just do it the same way as in the default theme, without understanding what they do. Since my OCD leaves me helpless to resist when facing an unanswered question, that option is not open to me. ;)
Last edited by mcdavis on May 28th, 2011, 1:22 pm, edited 5 times in total.
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

Re: Themes rejected.. missing window controls 4.0b1, Win7

Post by mcdavis »

Has anyone played with using binding to force chromemargin: 0,-1,-1,-1 on the #main-window to always hide the native title and show the custom title?


One issue here is that the chromemargin attribute is added/removed dynamically in response to showing/hiding the Firefox button/menubar, both when the browser starts and any time the user changes it after that. Also, that code is pretty monolithic and isn't really organized for anyone else (like an add-on) to jump into the middle of it and manage chromemargin separate from the other things that happen at the same time. It would be nice if it could be separated out.
Theme Development is Radical Participation.
NNL Beta Builds for Current and Up-coming Firefox
Dear User: Your Help is Needed
User avatar
ShareBird
Posts: 2740
Joined: December 8th, 2004, 7:09 am
Location: Berlin | Made in Brasil
Contact:

Re: Themes rejected.. window controls and titlebar theming.

Post by ShareBird »

Hi mcdavis,
thank you very much for the information!! And for sharing your observations on this issue.

I'm still needing to test my themes at Windows 7/Vista. It seems I will get some nightmares.

How are you testing personas at all? AFAIK, they are still not allowed to work with third-party themes and Personas Plus isn't compatible with FF versions > 3.6.
Silvermel - A Theme for Firefox and Thunderbird
YATT - Yet Another Theme Tutorial
Don't give a man a fish. Teach him how to fish instead.
Post Reply