1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 12:38:00 +01:00

Fix tab numbers again.

--HG--
extra : rebase_source : 8461c5bed454c0522fcad7a71163a4de338f55f7
This commit is contained in:
Kris Maglione
2010-12-17 02:43:41 -05:00
parent 41364b2111
commit d6fc8c5cb5
3 changed files with 13 additions and 14 deletions

View File

@@ -232,20 +232,17 @@ const ConfigBase = Class(ModuleBase, {
StatusLineExtended color: black !important; background: #a0FFa0 !important /* light-green */ StatusLineExtended color: black !important; background: #a0FFa0 !important /* light-green */
TabClose;.tab-close-button TabClose;.tab-close-button
TabIcon;.tab-icon TabIcon;.tab-icon min-width: 16px;
TabText;.tab-text TabText;.tab-text
TabNumber font-weight: bold; margin: 0px; padding-right: .3ex; TabNumber font-weight: bold; margin: 0px; padding-right: .8ex;
TabNumber::after content: counter(dactyl-tab-number);
TabIconNumber { TabIconNumber {
width: 16px; width: 16px;
margin-left: -16px; margin: 0 2px 0 -18px !important;
display: block;
font-weight: bold; font-weight: bold;
color: white; color: white;
text-align: center; text-align: center;
text-shadow: black -1px 0 1px, black 0 1px 1px, black 1px 0 1px, black 0 -1px 1px; text-shadow: black -1px 0 1px, black 0 1px 1px, black 1px 0 1px, black 0 -1px 1px;
} }
TabIconNumber::after content: counter(dactyl-tab-number);
Title color: magenta; background: white; font-weight: bold; Title color: magenta; background: white; font-weight: bold;
URL text-decoration: none; color: green; background: inherit; URL text-decoration: none; color: green; background: inherit;

View File

@@ -37,16 +37,20 @@ const Tabs = Module("tabs", {
}, },
_updateTabCount: function () { _updateTabCount: function () {
for (let tab in values(this.allTabs)) { for (let [i, tab] in Iterator(this.visibleTabs)) {
function node(clas) document.getAnonymousElementByAttribute(tab, "class", clas); function node(clas) document.getAnonymousElementByAttribute(tab, "class", clas);
if (!node("dactyl-tab-number")) { if (!node("dactyl-tab-number")) {
let nodes = {};
let dom = util.xmlToDom(<xul xmlns:xul={XUL} xmlns:html={XHTML} let dom = util.xmlToDom(<xul xmlns:xul={XUL} xmlns:html={XHTML}
><xul:hbox highlight="TabIconNumber" class="dactyl-tab-number" ><xul:hbox highlight="tab-number"><xul:label key="icon" align="center" highlight="TabIconNumber" class="dactyl-tab-number"/></xul:hbox
/><xul:hbox highlight="TabNumber" ><xul:hbox highlight="tab-number"><html:div key="label" highlight="TabNumber"/></xul:hbox
/></xul>.*, document); ></xul>.*, document, nodes);
let img = node("tab-icon-image"); let img = node("tab-icon-image");
img.parentNode.appendChild(dom); img.parentNode.appendChild(dom);
tab.__defineGetter__("ordinal", function () Number(nodes.icon.value));
tab.__defineSetter__("ordinal", function (i) nodes.icon.value = nodes.label.textContent = i);
} }
tab.ordinal = i + 1;
} }
statusline.updateTabCount(true); statusline.updateTabCount(true);
}, },

View File

@@ -80,10 +80,8 @@
@-moz-document @-moz-document
url-prefix(chrome://) { url-prefix(chrome://) {
xul|tabs, xul|tabbrowser { counter-reset: dactyl-tab-number; }
xul|tab { counter-increment: dacytl-tab-number; }
.tab-icon-image, .tab-throbber { -moz-box-ordinal-group: 10; } .tab-icon-image, .tab-throbber { -moz-box-ordinal-group: 10; }
[dactyl|highlight~=TabNumber], [dactyl|highlight~=TabIconNumber] { -moz-box-ordinal-group: 20; } [dactyl|highlight~=tab-number] { -moz-box-ordinal-group: 20; }
.tab-text, .tab-label, .tab-close-button { -moz-box-ordinal-group: 50; } .tab-text, .tab-label, .tab-close-button { -moz-box-ordinal-group: 50; }
#addon-bar > #addonbar-closebutton { #addon-bar > #addonbar-closebutton {