From 8e498ed52fd662c6ec47f91f96ac1bdcfbb0ae7c Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Tue, 4 Jan 2011 01:50:22 -0500 Subject: [PATCH] Style the Add-on Bar rather than the statusbar where applicable. --- common/content/commandline.js | 9 +++++++++ common/content/statusline.js | 10 +++++---- common/modules/config.jsm | 38 +++++++++++++++++------------------ common/skin/dactyl.css | 17 ++++++++-------- 4 files changed, 43 insertions(+), 31 deletions(-) diff --git a/common/content/commandline.js b/common/content/commandline.js index 76296218..f9936ed5 100644 --- a/common/content/commandline.js +++ b/common/content/commandline.js @@ -241,6 +241,15 @@ var CommandWidgets = Class("CommandWidgets", { } } } + // Hack. + function check(node) { + if (util.computedStyle(node).display === "-moz-stack") { + let nodes = Array.filter(node.children, function (n) !n.collapsed && n.boxObject.height); + nodes.forEach(function (node, i) node.style.opacity = (i == nodes.length - 1) ? "" : "0"); + } + Array.forEach(node.children, check); + } + [this.commandbar.container, this.statusbar.container].forEach(check); }, active: Class.memoize(Object), diff --git a/common/content/statusline.js b/common/content/statusline.js index 4adab3ed..1ee7bc4b 100644 --- a/common/content/statusline.js +++ b/common/content/statusline.js @@ -13,11 +13,12 @@ var StatusLine = Module("statusline", { this._statusLine = document.getElementById("status-bar"); this.statusBar = document.getElementById("addon-bar") || this._statusLine; this.statusBar.collapsed = true; // it is later restored unless the user sets laststatus=0 + this.baseGroup = this.statusBar == this._statusLine ? "StatusLine " : ""; if (this.statusBar.localName == "toolbar") { styles.system.add("addon-bar", config.styleableChrome, statusbar { -moz-box-flex: 1 } #addon-bar > #addonbar-closebutton { visibility: collapse; } #addon-bar > xul|toolbarspring { visibility: collapse; } @@ -26,9 +27,9 @@ var StatusLine = Module("statusline", { let _commandline = "if (window.dactyl) return dactyl.modules.commandline"; let prepend = - + -