Bug 878020 - Add inner shadows to the tab bar's scrollbox when overflowing. r=Gijs,enndeakin

--HG--
extra : rebase_source : 24145e62fb0001a84f0d5ec6f9a9e1135114c7af
This commit is contained in:
Dão Gottwald 2014-06-10 16:56:14 +02:00
Родитель 1c83c5ed8f
Коммит 71ccea9190
12 изменённых файлов: 88 добавлений и 77 удалений

Просмотреть файл

@ -1829,14 +1829,7 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
margin: 0 0 @tabToolbarNavbarOverlap@; margin: 0 0 @tabToolbarNavbarOverlap@;
} }
.tabbrowser-arrowscrollbox > .scrollbutton-up {
-moz-border-start: 0;
-moz-border-end: 2px solid transparent;
}
.tabbrowser-arrowscrollbox > .scrollbutton-down { .tabbrowser-arrowscrollbox > .scrollbutton-down {
-moz-border-start: 2px solid transparent;
-moz-border-end: 0;
transition: 1s box-shadow ease-out; transition: 1s box-shadow ease-out;
border-radius: 4px; border-radius: 4px;
} }
@ -1846,20 +1839,6 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
transition: none; transition: none;
} }
.tabbrowser-arrowscrollbox > .scrollbutton-up:not([disabled]):-moz-locale-dir(ltr),
.tabbrowser-arrowscrollbox > .scrollbutton-down:not([disabled]):-moz-locale-dir(rtl) {
border-width: 0 2px 0 0;
border-style: solid;
border-image: url("chrome://browser/skin/tabbrowser/tab-overflow-border.png") 0 2 0 2 fill;
}
.tabbrowser-arrowscrollbox > .scrollbutton-down:not([disabled]):-moz-locale-dir(ltr),
.tabbrowser-arrowscrollbox > .scrollbutton-up:not([disabled]):-moz-locale-dir(rtl) {
border-width: 0 0 0 2px;
border-style: solid;
border-image: url("chrome://browser/skin/tabbrowser/tab-overflow-border.png") 0 2 0 2 fill;
}
#TabsToolbar .toolbarbutton-1 { #TabsToolbar .toolbarbutton-1 {
margin-bottom: @tabToolbarNavbarOverlap@; margin-bottom: @tabToolbarNavbarOverlap@;
} }

Просмотреть файл

@ -165,7 +165,7 @@ browser.jar:
skin/classic/browser/tabbrowser/tab-background-end.png (tabbrowser/tab-background-end.png) skin/classic/browser/tabbrowser/tab-background-end.png (tabbrowser/tab-background-end.png)
skin/classic/browser/tabbrowser/tab-background-middle.png (tabbrowser/tab-background-middle.png) skin/classic/browser/tabbrowser/tab-background-middle.png (tabbrowser/tab-background-middle.png)
skin/classic/browser/tabbrowser/tab-background-start.png (tabbrowser/tab-background-start.png) skin/classic/browser/tabbrowser/tab-background-start.png (tabbrowser/tab-background-start.png)
skin/classic/browser/tabbrowser/tab-overflow-border.png (tabbrowser/tab-overflow-border.png) skin/classic/browser/tabbrowser/tab-overflow-indicator.png (../shared/tabbrowser/tab-overflow-indicator.png)
# NOTE: The following two files (tab-selected-end.svg, tab-selected-start.svg) get pre-processed in # NOTE: The following two files (tab-selected-end.svg, tab-selected-start.svg) get pre-processed in
# Makefile.in with a non-default marker of "%" and the result of that gets packaged. # Makefile.in with a non-default marker of "%" and the result of that gets packaged.

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 193 B

Просмотреть файл

@ -2971,20 +2971,6 @@ toolbarbutton.chevron > .toolbarbutton-menu-dropmarker {
} }
} }
.tabbrowser-arrowscrollbox > .scrollbutton-up:not([disabled]):-moz-locale-dir(ltr),
.tabbrowser-arrowscrollbox > .scrollbutton-down:not([disabled]):-moz-locale-dir(rtl) {
border-width: 0 2px 0 0;
border-style: solid;
border-image: url("chrome://browser/skin/tabbrowser/tab-overflow-border.png") 0 2 0 2 fill;
}
.tabbrowser-arrowscrollbox > .scrollbutton-down:not([disabled]):-moz-locale-dir(ltr),
.tabbrowser-arrowscrollbox > .scrollbutton-up:not([disabled]):-moz-locale-dir(rtl) {
border-width: 0 0 0 2px;
border-style: solid;
border-image: url("chrome://browser/skin/tabbrowser/tab-overflow-border.png") 0 2 0 2 fill;
}
/** /**
* Tabstrip & add-on bar toolbar buttons * Tabstrip & add-on bar toolbar buttons
*/ */

Просмотреть файл

@ -277,6 +277,7 @@ browser.jar:
skin/classic/browser/tabbrowser/tab-background-middle@2x.png (tabbrowser/tab-background-middle@2x.png) skin/classic/browser/tabbrowser/tab-background-middle@2x.png (tabbrowser/tab-background-middle@2x.png)
skin/classic/browser/tabbrowser/tab-background-start.png (tabbrowser/tab-background-start.png) skin/classic/browser/tabbrowser/tab-background-start.png (tabbrowser/tab-background-start.png)
skin/classic/browser/tabbrowser/tab-background-start@2x.png (tabbrowser/tab-background-start@2x.png) skin/classic/browser/tabbrowser/tab-background-start@2x.png (tabbrowser/tab-background-start@2x.png)
skin/classic/browser/tabbrowser/tab-overflow-indicator.png (../shared/tabbrowser/tab-overflow-indicator.png)
# NOTE: The following two files (tab-selected-end.svg, tab-selected-start.svg) get pre-processed in # NOTE: The following two files (tab-selected-end.svg, tab-selected-start.svg) get pre-processed in
# Makefile.in with a non-default marker of "%" and the result of that gets packaged. # Makefile.in with a non-default marker of "%" and the result of that gets packaged.
@ -287,7 +288,6 @@ browser.jar:
skin/classic/browser/tabbrowser/tab-stroke-end@2x.png (tabbrowser/tab-stroke-end@2x.png) skin/classic/browser/tabbrowser/tab-stroke-end@2x.png (tabbrowser/tab-stroke-end@2x.png)
skin/classic/browser/tabbrowser/tab-stroke-start.png (tabbrowser/tab-stroke-start.png) skin/classic/browser/tabbrowser/tab-stroke-start.png (tabbrowser/tab-stroke-start.png)
skin/classic/browser/tabbrowser/tab-stroke-start@2x.png (tabbrowser/tab-stroke-start@2x.png) skin/classic/browser/tabbrowser/tab-stroke-start@2x.png (tabbrowser/tab-stroke-start@2x.png)
skin/classic/browser/tabbrowser/tab-overflow-border.png (tabbrowser/tab-overflow-border.png)
skin/classic/browser/tabbrowser/tabDragIndicator.png (tabbrowser/tabDragIndicator.png) skin/classic/browser/tabbrowser/tabDragIndicator.png (tabbrowser/tabDragIndicator.png)
skin/classic/browser/tabbrowser/tabDragIndicator@2x.png (tabbrowser/tabDragIndicator@2x.png) skin/classic/browser/tabbrowser/tabDragIndicator@2x.png (tabbrowser/tabDragIndicator@2x.png)
skin/classic/browser/tabbrowser/tab-separator.png (tabbrowser/tab-separator.png) skin/classic/browser/tabbrowser/tab-separator.png (tabbrowser/tab-separator.png)

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 184 B

Двоичные данные
browser/themes/shared/tabbrowser/tab-overflow-indicator.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 578 B

Просмотреть файл

@ -130,6 +130,43 @@
-moz-padding-start: @tabCurveHalfWidth@; -moz-padding-start: @tabCurveHalfWidth@;
} }
/* Tab Overflow */
.tabbrowser-arrowscrollbox > .arrowscrollbox-overflow-start-indicator:not([collapsed]),
.tabbrowser-arrowscrollbox > .arrowscrollbox-overflow-end-indicator:not([collapsed]) {
background-image: url(chrome://browser/skin/tabbrowser/tab-overflow-indicator.png);
background-size: 100% 100%;
width: 14px;
margin-bottom: @tabToolbarNavbarOverlap@;
pointer-events: none;
position: relative;
z-index: 3; /* the selected tab's z-index + 1 */
}
.tabbrowser-arrowscrollbox > .arrowscrollbox-overflow-start-indicator:-moz-locale-dir(rtl),
.tabbrowser-arrowscrollbox > .arrowscrollbox-overflow-end-indicator:-moz-locale-dir(ltr) {
transform: scaleX(-1);
}
.tabbrowser-arrowscrollbox > .arrowscrollbox-overflow-start-indicator:not([collapsed]) {
-moz-margin-start: -2px;
-moz-margin-end: -12px;
}
.tabbrowser-arrowscrollbox > .arrowscrollbox-overflow-end-indicator:not([collapsed]) {
-moz-margin-start: -12px;
-moz-margin-end: -2px;
}
.tabbrowser-arrowscrollbox > .arrowscrollbox-overflow-start-indicator[collapsed],
.tabbrowser-arrowscrollbox > .arrowscrollbox-overflow-end-indicator[collapsed] {
opacity: 0;
}
.tabbrowser-arrowscrollbox > .arrowscrollbox-overflow-start-indicator,
.tabbrowser-arrowscrollbox > .arrowscrollbox-overflow-end-indicator {
transition: opacity 150ms ease;
}
.tab-background-start[selected=true]::after, .tab-background-start[selected=true]::after,
.tab-background-start[selected=true]::before, .tab-background-start[selected=true]::before,
.tab-background-start, .tab-background-start,

Просмотреть файл

@ -1855,9 +1855,6 @@ toolbarbutton[type="socialmark"] > .toolbarbutton-icon {
.tabbrowser-arrowscrollbox > .scrollbutton-down { .tabbrowser-arrowscrollbox > .scrollbutton-down {
list-style-image: url("chrome://browser/skin/tabbrowser/tab-arrow-left.png"); list-style-image: url("chrome://browser/skin/tabbrowser/tab-arrow-left.png");
margin: 0 0 @tabToolbarNavbarOverlap@; margin: 0 0 @tabToolbarNavbarOverlap@;
padding-right: 2px;
border-right: 2px solid transparent;
background-origin: border-box;
} }
#TabsToolbar[brighttext] > #tabbrowser-tabs > .tabbrowser-arrowscrollbox > .scrollbutton-up, #TabsToolbar[brighttext] > #tabbrowser-tabs > .tabbrowser-arrowscrollbox > .scrollbutton-up,
@ -1884,13 +1881,6 @@ toolbarbutton[type="socialmark"] > .toolbarbutton-icon {
transition: none; transition: none;
} }
.tabbrowser-arrowscrollbox > .scrollbutton-up:not([disabled]),
.tabbrowser-arrowscrollbox > .scrollbutton-down:not([disabled]) {
border-width: 0 2px 0 0;
border-style: solid;
border-image: url("chrome://browser/skin/tabbrowser/tab-overflow-border.png") 0 2 0 2 fill;
}
.tabs-newtab-button > .toolbarbutton-icon { .tabs-newtab-button > .toolbarbutton-icon {
margin-top: -1px; margin-top: -1px;
margin-bottom: -1px; margin-bottom: -1px;

Просмотреть файл

@ -196,7 +196,7 @@ browser.jar:
skin/classic/browser/tabbrowser/tab-background-middle@2x.png (tabbrowser/tab-background-middle@2x.png) skin/classic/browser/tabbrowser/tab-background-middle@2x.png (tabbrowser/tab-background-middle@2x.png)
skin/classic/browser/tabbrowser/tab-background-end.png (tabbrowser/tab-background-end.png) skin/classic/browser/tabbrowser/tab-background-end.png (tabbrowser/tab-background-end.png)
skin/classic/browser/tabbrowser/tab-background-end@2x.png (tabbrowser/tab-background-end@2x.png) skin/classic/browser/tabbrowser/tab-background-end@2x.png (tabbrowser/tab-background-end@2x.png)
skin/classic/browser/tabbrowser/tab-overflow-border.png (tabbrowser/tab-overflow-border.png) skin/classic/browser/tabbrowser/tab-overflow-indicator.png (../shared/tabbrowser/tab-overflow-indicator.png)
# NOTE: The following two files (tab-selected-end.svg, tab-selected-start.svg) get pre-processed in # NOTE: The following two files (tab-selected-end.svg, tab-selected-start.svg) get pre-processed in
# Makefile.in with a non-default marker of "%" and the result of that gets packaged. # Makefile.in with a non-default marker of "%" and the result of that gets packaged.
@ -601,7 +601,7 @@ browser.jar:
skin/classic/aero/browser/tabbrowser/tab-background-middle@2x.png (tabbrowser/tab-background-middle@2x.png) skin/classic/aero/browser/tabbrowser/tab-background-middle@2x.png (tabbrowser/tab-background-middle@2x.png)
skin/classic/aero/browser/tabbrowser/tab-background-end.png (tabbrowser/tab-background-end.png) skin/classic/aero/browser/tabbrowser/tab-background-end.png (tabbrowser/tab-background-end.png)
skin/classic/aero/browser/tabbrowser/tab-background-end@2x.png (tabbrowser/tab-background-end@2x.png) skin/classic/aero/browser/tabbrowser/tab-background-end@2x.png (tabbrowser/tab-background-end@2x.png)
skin/classic/aero/browser/tabbrowser/tab-overflow-border.png (tabbrowser/tab-overflow-border.png) skin/classic/aero/browser/tabbrowser/tab-overflow-indicator.png (../shared/tabbrowser/tab-overflow-indicator.png)
# NOTE: The following two files (tab-selected-end.svg, tab-selected-start.svg) get pre-processed in # NOTE: The following two files (tab-selected-end.svg, tab-selected-start.svg) get pre-processed in
# Makefile.in with a non-default marker of "%" and the result of that gets packaged. # Makefile.in with a non-default marker of "%" and the result of that gets packaged.

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 193 B

Просмотреть файл

@ -27,23 +27,30 @@
<content> <content>
<xul:autorepeatbutton class="autorepeatbutton-up" <xul:autorepeatbutton class="autorepeatbutton-up"
anonid="scrollbutton-up" anonid="scrollbutton-up"
collapsed="true" xbl:inherits="orient,collapsed=notoverflowing,disabled=scrolledtostart"
xbl:inherits="orient"
oncommand="_autorepeatbuttonScroll(event);"/> oncommand="_autorepeatbuttonScroll(event);"/>
<xul:spacer class="arrowscrollbox-overflow-start-indicator"
xbl:inherits="collapsed=scrolledtostart"/>
<xul:scrollbox class="arrowscrollbox-scrollbox" <xul:scrollbox class="arrowscrollbox-scrollbox"
anonid="scrollbox" anonid="scrollbox"
flex="1" flex="1"
xbl:inherits="orient,align,pack,dir"> xbl:inherits="orient,align,pack,dir">
<children/> <children/>
</xul:scrollbox> </xul:scrollbox>
<xul:spacer class="arrowscrollbox-overflow-end-indicator"
xbl:inherits="collapsed=scrolledtoend"/>
<xul:autorepeatbutton class="autorepeatbutton-down" <xul:autorepeatbutton class="autorepeatbutton-down"
anonid="scrollbutton-down" anonid="scrollbutton-down"
collapsed="true" xbl:inherits="orient,collapsed=notoverflowing,disabled=scrolledtoend"
xbl:inherits="orient"
oncommand="_autorepeatbuttonScroll(event);"/> oncommand="_autorepeatbuttonScroll(event);"/>
</content> </content>
<implementation> <implementation>
<constructor><![CDATA[
this.setAttribute("notoverflowing", "true");
this._updateScrollButtonsDisabledState();
]]></constructor>
<destructor><![CDATA[ <destructor><![CDATA[
this._stopSmoothScroll(); this._stopSmoothScroll();
]]></destructor> ]]></destructor>
@ -454,28 +461,39 @@
<method name="_updateScrollButtonsDisabledState"> <method name="_updateScrollButtonsDisabledState">
<body><![CDATA[ <body><![CDATA[
var disableUpButton = false; var scrolledToStart = false;
var disableDownButton = false; var scrolledToEnd = false;
if (this.scrollPosition == 0) { if (this.hasAttribute("notoverflowing")) {
scrolledToStart = true;
scrolledToEnd = true;
}
else if (this.scrollPosition == 0) {
// In the RTL case, this means the _last_ element in the // In the RTL case, this means the _last_ element in the
// scrollbox is visible // scrollbox is visible
if (this._isRTLScrollbox) if (this._isRTLScrollbox)
disableDownButton = true; scrolledToEnd = true;
else else
disableUpButton = true; scrolledToStart = true;
} }
else if (this.scrollClientSize + this.scrollPosition == this.scrollSize) { else if (this.scrollClientSize + this.scrollPosition == this.scrollSize) {
// In the RTL case, this means the _first_ element in the // In the RTL case, this means the _first_ element in the
// scrollbox is visible // scrollbox is visible
if (this._isRTLScrollbox) if (this._isRTLScrollbox)
disableUpButton = true; scrolledToStart = true;
else else
disableDownButton = true; scrolledToEnd = true;
} }
this._scrollButtonUp.disabled = disableUpButton; if (scrolledToEnd)
this._scrollButtonDown.disabled = disableDownButton; this.setAttribute("scrolledtoend", "true");
else
this.removeAttribute("scrolledtoend");
if (scrolledToStart)
this.setAttribute("scrolledtostart", "true");
else
this.removeAttribute("scrolledtostart");
]]></body> ]]></body>
</method> </method>
</implementation> </implementation>
@ -535,8 +553,8 @@
return; return;
} }
this._scrollButtonUp.collapsed = true; this.setAttribute("notoverflowing", "true");
this._scrollButtonDown.collapsed = true;
try { try {
// See bug 341047 and comments in overflow handler as to why // See bug 341047 and comments in overflow handler as to why
// try..catch is needed here // try..catch is needed here
@ -545,8 +563,7 @@
this.ensureElementIsVisible(childNodes[0], false); this.ensureElementIsVisible(childNodes[0], false);
} }
catch(e) { catch(e) {
this._scrollButtonUp.collapsed = false; this.removeAttribute("notoverflowing");
this._scrollButtonDown.collapsed = false;
} }
]]></handler> ]]></handler>
@ -569,20 +586,18 @@
return; return;
} }
this._scrollButtonUp.collapsed = false; this.removeAttribute("notoverflowing");
this._scrollButtonDown.collapsed = false;
try { try {
// See bug 341047, the overflow event is dispatched when the // See bug 341047, the overflow event is dispatched when the
// scrollbox already is mostly destroyed. This causes some code in // scrollbox already is mostly destroyed. This causes some code in
// _updateScrollButtonsDisabledState() to throw an error. It also // _updateScrollButtonsDisabledState() to throw an error. It also
// means that the scrollbarbuttons were uncollapsed when that should // means that the notoverflowing attribute was removed erroneously,
// not be happening, because the whole overflow event should not be // as the whole overflow event should not be happening in that case.
// happening in that case.
this._updateScrollButtonsDisabledState(); this._updateScrollButtonsDisabledState();
} }
catch(e) { catch(e) {
this._scrollButtonUp.collapsed = true; this.setAttribute("notoverflowing", "true");
this._scrollButtonDown.collapsed = true;
} }
]]></handler> ]]></handler>
@ -598,22 +613,26 @@
<binding id="arrowscrollbox-clicktoscroll" extends="chrome://global/content/bindings/scrollbox.xml#arrowscrollbox"> <binding id="arrowscrollbox-clicktoscroll" extends="chrome://global/content/bindings/scrollbox.xml#arrowscrollbox">
<content> <content>
<xul:toolbarbutton class="scrollbutton-up" collapsed="true" <xul:toolbarbutton class="scrollbutton-up"
xbl:inherits="orient" xbl:inherits="orient,collapsed=notoverflowing,disabled=scrolledtostart"
anonid="scrollbutton-up" anonid="scrollbutton-up"
onclick="_distanceScroll(event);" onclick="_distanceScroll(event);"
onmousedown="if (event.button == 0) _startScroll(-1);" onmousedown="if (event.button == 0) _startScroll(-1);"
onmouseup="if (event.button == 0) _stopScroll();" onmouseup="if (event.button == 0) _stopScroll();"
onmouseover="_continueScroll(-1);" onmouseover="_continueScroll(-1);"
onmouseout="_pauseScroll();"/> onmouseout="_pauseScroll();"/>
<xul:spacer class="arrowscrollbox-overflow-start-indicator"
xbl:inherits="collapsed=scrolledtostart"/>
<xul:scrollbox class="arrowscrollbox-scrollbox" <xul:scrollbox class="arrowscrollbox-scrollbox"
anonid="scrollbox" anonid="scrollbox"
flex="1" flex="1"
xbl:inherits="orient,align,pack,dir"> xbl:inherits="orient,align,pack,dir">
<children/> <children/>
</xul:scrollbox> </xul:scrollbox>
<xul:toolbarbutton class="scrollbutton-down" collapsed="true" <xul:spacer class="arrowscrollbox-overflow-end-indicator"
xbl:inherits="orient" xbl:inherits="collapsed=scrolledtoend"/>
<xul:toolbarbutton class="scrollbutton-down"
xbl:inherits="orient,collapsed=notoverflowing,disabled=scrolledtoend"
anonid="scrollbutton-down" anonid="scrollbutton-down"
onclick="_distanceScroll(event);" onclick="_distanceScroll(event);"
onmousedown="if (event.button == 0) _startScroll(1);" onmousedown="if (event.button == 0) _startScroll(1);"