зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1191451 - Adding color to the top of tabs to indicate user context of tab. r=paolo
This commit is contained in:
Родитель
41dc555dc0
Коммит
8a514ecd12
|
@ -1802,6 +1802,8 @@
|
|||
|
||||
var uriIsAboutBlank = !aURI || aURI == "about:blank";
|
||||
|
||||
if (aUserContextId)
|
||||
t.setAttribute("usercontextid", aUserContextId);
|
||||
t.setAttribute("crop", "end");
|
||||
t.setAttribute("onerror", "this.removeAttribute('image');");
|
||||
t.className = "tabbrowser-tab";
|
||||
|
@ -2522,6 +2524,10 @@
|
|||
aOurTab.setAttribute("soundplaying", "true");
|
||||
modifiedAttrs.push("soundplaying");
|
||||
}
|
||||
if (aOtherTab.hasAttribute("usercontextid")) {
|
||||
aOurTab.setAttribute("usercontextid", aOtherTab.getAttribute("usercontextid"));
|
||||
modifiedAttrs.push("usercontextid");
|
||||
}
|
||||
|
||||
// If the other tab is pending (i.e. has not been restored, yet)
|
||||
// then do not switch docShells but retrieve the other tab's state
|
||||
|
|
|
@ -397,6 +397,31 @@
|
|||
background-size: @tabCurveWidth@ 100%, calc(100% - (2 * @tabCurveWidth@)) 100%, @tabCurveWidth@ 100%;
|
||||
}
|
||||
|
||||
/* User Context UI - change tab decoration depending on userContextId.
|
||||
Defaults to gray for unknown usercontextids. */
|
||||
.tabbrowser-tab[usercontextid] {
|
||||
background-image: linear-gradient(to right, transparent 20%, #909090 30%, #909090 70%, transparent 80%);
|
||||
background-size: auto 2px;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
/* Personal User Context */
|
||||
.tabbrowser-tab[usercontextid="1"] {
|
||||
background-image: linear-gradient(to right, transparent 20%, #00a7e0 30%, #00a7e0 70%, transparent 80%);
|
||||
}
|
||||
/* Work User Context */
|
||||
.tabbrowser-tab[usercontextid="2"] {
|
||||
background-image: linear-gradient(to right, transparent 20%, #f89c24 30%, #f89c24 70%, transparent 80%);
|
||||
}
|
||||
/* Banking User Context */
|
||||
.tabbrowser-tab[usercontextid="3"] {
|
||||
background-image: linear-gradient(to right, transparent 20%, #7dc14c 30%, #7dc14c 70%, transparent 80%);
|
||||
}
|
||||
/* Shopping User Context */
|
||||
.tabbrowser-tab[usercontextid="4"] {
|
||||
background-image: linear-gradient(to right, transparent 20%, #ee5195 30%, #ee5195 70%, transparent 80%);
|
||||
}
|
||||
|
||||
/* Tab pointer-events */
|
||||
.tabbrowser-tab {
|
||||
pointer-events: none;
|
||||
|
|
Загрузка…
Ссылка в новой задаче