Skip to content

Commit

Permalink
Bug 1008424 - Remove unintended gradient from the tab toolbar's backg…
Browse files Browse the repository at this point in the history
…round. r=mconley,jjmathies
  • Loading branch information
daogottwald committed May 21, 2014
1 parent d15dbe0 commit 0d96435
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 42 deletions.
8 changes: 0 additions & 8 deletions browser/base/content/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -4452,11 +4452,6 @@ var TabsInTitlebar = {
fullTabsHeight += verticalMargins(tabsStyles);
#endif

// If the navbar overlaps the tabbar using negative margins, we need to take those into
// account so we don't overlap it
let navbarMarginTop = parseFloat(window.getComputedStyle($("nav-bar")).marginTop);
navbarMarginTop = Math.min(navbarMarginTop, 0);

// And get the height of what's in the titlebar:
let titlebarContentHeight = rect(titlebarContent).height;

Expand Down Expand Up @@ -4497,9 +4492,6 @@ var TabsInTitlebar = {
// We need to increase the titlebar content's outer height (ie including margins)
// to match the tab and menu height:
let extraMargin = tabAndMenuHeight - titlebarContentHeight;
// We need to reduce the height by the amount of navbar overlap
// (this value is 0 or negative):
extraMargin += navbarMarginTop;
// On non-OSX, we can just use bottom margin:
#ifndef XP_MACOSX
titlebarContent.style.marginBottom = extraMargin + "px";
Expand Down
29 changes: 5 additions & 24 deletions browser/themes/windows/browser-aero.css
Original file line number Diff line number Diff line change
Expand Up @@ -188,24 +188,6 @@
background-clip: padding-box;
}

/* Toolbar shadow behind tabs */
#nav-bar {
border-top: 1px solid @toolbarShadowColor@ !important;
background-clip: padding-box;
}

/* This code is only needed for restored windows (i.e. sizemode=normal)
because of the border radius on the toolbar below the tab bar. */
#main-window[sizemode=normal] #nav-bar {
border-top: 1px solid @toolbarShadowColor@;
background-clip: padding-box;
}

/* Cover the top border of the adjacent toolbar */
#TabsToolbar {
margin-bottom: -1px;
}

#main-window[sizemode=normal] #TabsToolbar {
padding-left: 1px;
padding-right: 1px;
Expand All @@ -229,11 +211,6 @@

@media (-moz-os-version: windows-vista),
(-moz-os-version: windows-win7) {
#main-window[sizemode=normal] #nav-bar {
border-top-left-radius: 2.5px;
border-top-right-radius: 2.5px;
}

#main-menubar:not(:-moz-lwtheme):not(:-moz-window-inactive) {
border-radius: 4px;
}
Expand All @@ -257,6 +234,11 @@
}

@media (-moz-windows-glass) {
#main-window[sizemode=normal] #nav-bar {
border-top-left-radius: 2.5px;
border-top-right-radius: 2.5px;
}

#main-window[sizemode=fullscreen]:not(:-moz-lwtheme) {
-moz-appearance: none;
background-color: #556;
Expand All @@ -265,7 +247,6 @@
/* Glass Fog */

#TabsToolbar:not(:-moz-lwtheme) {
background-image: none;
position: relative;
}

Expand Down
23 changes: 14 additions & 9 deletions browser/themes/windows/browser.css
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,6 @@
#main-window[tabsintitlebar] #main-menubar > menu:not(:-moz-lwtheme) {
color: inherit;
}

#TabsToolbar:-moz-lwtheme {
background: linear-gradient(to top, @toolbarShadowColor@ 2px, transparent 2px);
}
%ifdef WINDOWS_AERO
}
%endif
Expand Down Expand Up @@ -272,17 +268,29 @@
}

#TabsToolbar:not([collapsed="true"]) + #nav-bar {
margin-top: -@tabToolbarNavbarOverlap@; /* Move up into the TabsToolbar */
margin-top: -1px; /* Move up into the TabsToolbar for the inner highlight at the top of the nav-bar */
/* Position the toolbar above the bottom of background tabs */
position: relative;
z-index: 1;
}

#nav-bar {
border-top: 1px solid @toolbarShadowColor@ !important;
background-clip: padding-box;
background-image: linear-gradient(@toolbarHighlight@, rgba(255,255,255,0));
box-shadow: 0 1px 0 @toolbarHighlight@ inset;
}

%ifdef WINDOWS_AERO
@media not all and (-moz-windows-compositor) {
%endif
#TabsToolbar[collapsed="true"] + #nav-bar {
border-top-style: none !important;
}
%ifdef WINDOWS_AERO
}
%endif

#personal-bookmarks {
min-height: 24px;
}
Expand Down Expand Up @@ -1746,10 +1754,7 @@ toolbarbutton[type="socialmark"] > .toolbarbutton-icon {
#TabsToolbar {
min-height: 0;
padding: 0;
}

#main-window:not([customizing]) #TabsToolbar:not(:-moz-lwtheme) {
background-image: linear-gradient(to top, @toolbarShadowColor@ 2px, rgba(0,0,0,.05) 2px, transparent 50%);
margin-bottom: -@tabToolbarNavbarOverlap@; /* overlap the nav-bar's top border */
}

#main-window[tabsintitlebar] #TabsToolbar {
Expand Down
1 change: 0 additions & 1 deletion widget/windows/nsNativeThemeWin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3846,7 +3846,6 @@ nsresult nsNativeThemeWin::ClassicDrawWidgetBackground(nsRenderingContext* aCont
{
RECT rect = widgetRect;
int32_t offset = GetSystemMetrics(SM_CXFRAME);
rect.bottom -= 1;

// first fill the area to the color of the window background
FillRect(hdc, &rect, (HBRUSH)(COLOR_3DFACE+1));
Expand Down

0 comments on commit 0d96435

Please sign in to comment.