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

Style the Add-on Bar rather than the statusbar where applicable.

This commit is contained in:
Kris Maglione
2011-01-04 01:50:22 -05:00
parent f8476edbbd
commit 8e498ed52f
4 changed files with 43 additions and 31 deletions

View File

@@ -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),

View File

@@ -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, <css><![CDATA[
#status-bar { margin-top: 0 !important; }
#addon-bar { padding: 0 !important; min-height: 18px !important; }
#addon-bar { padding: 0 !important; min-height: 18px !important; -moz-appearance: none !important; }
#addon-bar > 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 = <e4x xmlns={XUL} xmlns:dactyl={NS}>
<statusbar id="status-bar" highlight="StatusLine StatusLineNormal">
<statusbar id="status-bar" highlight="StatusLine">
<!-- insertbefore="dactyl.statusBefore;" insertafter="dactyl.statusAfter;" -->
<hbox style="background: inherit;" key="container" flex="1" hidden="false" align="center">
<hbox key="container" hidden="false" align="center" flex="1">
<stack orient="horizontal" align="stretch" flex="1" class="dactyl-container" highlight="CmdLine StatusCmdLine">
<hbox class="dactyl-container" highlight="CmdLine StatusCmdLine">
<label key="mode" crop="end" class="plain" collapsed="true"/>
@@ -64,6 +65,7 @@ var StatusLine = Module("statusline", {
objects: this.widgets = { get status() this.container },
prepend: prepend.elements()
});
this.class = "insecure";
},
get visible() !this.statusBar.collapsed && !this.statusBar.hidden,
@@ -87,7 +89,7 @@ var StatusLine = Module("statusline", {
insecure: "StatusLineNormal"
};
highlight.highlightNode(this._statusLine, "StatusLine " + highlightGroup[type]);
highlight.highlightNode(this.statusBar, this.baseGroup + highlightGroup[type]);
},
get class() this._class,

View File

@@ -314,23 +314,23 @@ var ConfigBase = Class("ConfigBase", {
CmdWarningMsg;[dactyl|highlight] &#x0d; StatusWarningMsg;[dactyl|highlight]
Normal color: black !important; background: white !important; font-weight: normal !important;
StatusNormal color: inherit !important; background: inherit !important;
StatusNormal color: inherit !important; background: transparent !important;
ErrorMsg color: white !important; background: red !important; font-weight: bold !important;
InfoMsg color: black !important; background: white !important;
StatusInfoMsg color: inherit !important; background: inherit !important;
StatusInfoMsg color: inherit !important; background: transparent !important;
LineNr color: orange !important; background: white !important;
ModeMsg color: black !important; background: white !important;
StatusModeMsg color: inherit !important; background: inherit !important; padding-right: 1em;
StatusModeMsg color: inherit !important; background: transparent !important; padding-right: 1em;
MoreMsg color: green !important; background: white !important;
StatusMoreMsg background: inherit !important;
StatusMoreMsg background: transparent !important;
Message white-space: pre-wrap !important; min-width: 100%; width: 100%; padding-left: 4em; text-indent: -4em; display: block;
Message String white-space: pre-wrap;
NonText color: blue; background: transparent !important;
*Preview color: gray;
Question color: green !important; background: white !important; font-weight: bold !important;
StatusQuestion color: green !important; background: inherit !important;
StatusQuestion color: green !important; background: transparent !important;
WarningMsg color: red !important; background: white !important;
StatusWarningMsg color: red !important; background: inherit !important;
StatusWarningMsg color: red !important; background: transparent !important;
CmdLine;>*;;FontFixed padding: 1px !important;
CmdPrompt;.dactyl-commandline-prompt
@@ -381,11 +381,11 @@ var ConfigBase = Class("ConfigBase", {
Usage>LineInfo position: absolute; left: 100%; padding: 1ex; margin: -1ex -1em; background: rgba(255, 255, 255, .8); border-radius: 1ex;
Usage:not(:hover)>LineInfo opacity: 0; left: 0; width: 1px; height: 1px; overflow: hidden;
StatusLine;;;FontFixed font-weight: bold; -moz-appearance: none !important; border: 0px !important; min-height: 18px !important;
StatusLineNormal color: white !important; background: black !important;
StatusLineBroken color: black !important; background: #FFa0a0 !important /* light-red */
StatusLineSecure color: black !important; background: #a0a0FF !important /* light-blue */
StatusLineExtended color: black !important; background: #a0FFa0 !important /* light-green */
StatusLine;;;FontFixed font-weight: bold; background: transparent !important; -moz-appearance: none !important; border: 0px !important; min-height: 18px !important;
StatusLineNormal;[dactyl|highlight] color: white !important; background: black !important;
StatusLineBroken;[dactyl|highlight] color: black !important; background: #FFa0a0 !important /* light-red */
StatusLineSecure;[dactyl|highlight] color: black !important; background: #a0a0FF !important /* light-blue */
StatusLineExtended;[dactyl|highlight] color: black !important; background: #a0FFa0 !important /* light-green */
TabClose;.tab-close-button
TabIcon;.tab-icon min-width: 16px;

View File

@@ -98,9 +98,15 @@ window[dactyl|highlight~=Bell] > * {
}
[dactyl|highlight~=CmdLine] {
background: inherit !important;
/* background: inherit !important; */
color: inherit !important;
}
.dactyl-status-field-url {
/* background-color: inherit !important; */
color: inherit !important;
}
[dactyl|highlight~=CmdLine],
[dactyl|highlight~=CmdLine] > [dactyl|highlight~=CmdLine] {
padding: 0px !important;
@@ -131,11 +137,6 @@ statusbarpanel {
background: transparent;
}
.dactyl-status-field-url {
background-color: inherit !important;
color: inherit !important;
}
/* no longer at the window's bottom right corner */
.statusbar-resizerpanel {
display: none;
@@ -145,12 +146,12 @@ statusbarpanel {
}
.dactyl-commandline-prompt {
background-color: inherit;
/* background-color: inherit; */
margin: 0px;
padding: 0px;
}
.dactyl-commandline-command {
background-color: inherit !important;
/* background-color: inherit !important; */
color: inherit !important;
margin: 0px;
}