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:
@@ -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),
|
active: Class.memoize(Object),
|
||||||
|
|||||||
@@ -13,11 +13,12 @@ var StatusLine = Module("statusline", {
|
|||||||
this._statusLine = document.getElementById("status-bar");
|
this._statusLine = document.getElementById("status-bar");
|
||||||
this.statusBar = document.getElementById("addon-bar") || this._statusLine;
|
this.statusBar = document.getElementById("addon-bar") || this._statusLine;
|
||||||
this.statusBar.collapsed = true; // it is later restored unless the user sets laststatus=0
|
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") {
|
if (this.statusBar.localName == "toolbar") {
|
||||||
styles.system.add("addon-bar", config.styleableChrome, <css><![CDATA[
|
styles.system.add("addon-bar", config.styleableChrome, <css><![CDATA[
|
||||||
#status-bar { margin-top: 0 !important; }
|
#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 > statusbar { -moz-box-flex: 1 }
|
||||||
#addon-bar > #addonbar-closebutton { visibility: collapse; }
|
#addon-bar > #addonbar-closebutton { visibility: collapse; }
|
||||||
#addon-bar > xul|toolbarspring { 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 _commandline = "if (window.dactyl) return dactyl.modules.commandline";
|
||||||
let prepend = <e4x xmlns={XUL} xmlns:dactyl={NS}>
|
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;" -->
|
<!-- 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">
|
<stack orient="horizontal" align="stretch" flex="1" class="dactyl-container" highlight="CmdLine StatusCmdLine">
|
||||||
<hbox class="dactyl-container" highlight="CmdLine StatusCmdLine">
|
<hbox class="dactyl-container" highlight="CmdLine StatusCmdLine">
|
||||||
<label key="mode" crop="end" class="plain" collapsed="true"/>
|
<label key="mode" crop="end" class="plain" collapsed="true"/>
|
||||||
@@ -64,6 +65,7 @@ var StatusLine = Module("statusline", {
|
|||||||
objects: this.widgets = { get status() this.container },
|
objects: this.widgets = { get status() this.container },
|
||||||
prepend: prepend.elements()
|
prepend: prepend.elements()
|
||||||
});
|
});
|
||||||
|
this.class = "insecure";
|
||||||
},
|
},
|
||||||
|
|
||||||
get visible() !this.statusBar.collapsed && !this.statusBar.hidden,
|
get visible() !this.statusBar.collapsed && !this.statusBar.hidden,
|
||||||
@@ -87,7 +89,7 @@ var StatusLine = Module("statusline", {
|
|||||||
insecure: "StatusLineNormal"
|
insecure: "StatusLineNormal"
|
||||||
};
|
};
|
||||||
|
|
||||||
highlight.highlightNode(this._statusLine, "StatusLine " + highlightGroup[type]);
|
highlight.highlightNode(this.statusBar, this.baseGroup + highlightGroup[type]);
|
||||||
},
|
},
|
||||||
get class() this._class,
|
get class() this._class,
|
||||||
|
|
||||||
|
|||||||
@@ -313,24 +313,24 @@ var ConfigBase = Class("ConfigBase", {
|
|||||||
CmdQuestion;[dactyl|highlight] 
 StatusQuestion;[dactyl|highlight]
|
CmdQuestion;[dactyl|highlight] 
 StatusQuestion;[dactyl|highlight]
|
||||||
CmdWarningMsg;[dactyl|highlight] 
 StatusWarningMsg;[dactyl|highlight]
|
CmdWarningMsg;[dactyl|highlight] 
 StatusWarningMsg;[dactyl|highlight]
|
||||||
|
|
||||||
Normal color: black !important; background: white !important; font-weight: normal !important;
|
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;
|
ErrorMsg color: white !important; background: red !important; font-weight: bold !important;
|
||||||
InfoMsg color: black !important; background: white !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;
|
LineNr color: orange !important; background: white !important;
|
||||||
ModeMsg color: black !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;
|
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 white-space: pre-wrap !important; min-width: 100%; width: 100%; padding-left: 4em; text-indent: -4em; display: block;
|
||||||
Message String white-space: pre-wrap;
|
Message String white-space: pre-wrap;
|
||||||
NonText color: blue; background: transparent !important;
|
NonText color: blue; background: transparent !important;
|
||||||
*Preview color: gray;
|
*Preview color: gray;
|
||||||
Question color: green !important; background: white !important; font-weight: bold !important;
|
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;
|
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;
|
CmdLine;>*;;FontFixed padding: 1px !important;
|
||||||
CmdPrompt;.dactyl-commandline-prompt
|
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>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;
|
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;
|
StatusLine;;;FontFixed font-weight: bold; background: transparent !important; -moz-appearance: none !important; border: 0px !important; min-height: 18px !important;
|
||||||
StatusLineNormal color: white !important; background: black !important;
|
StatusLineNormal;[dactyl|highlight] color: white !important; background: black !important;
|
||||||
StatusLineBroken color: black !important; background: #FFa0a0 !important /* light-red */
|
StatusLineBroken;[dactyl|highlight] color: black !important; background: #FFa0a0 !important /* light-red */
|
||||||
StatusLineSecure color: black !important; background: #a0a0FF !important /* light-blue */
|
StatusLineSecure;[dactyl|highlight] color: black !important; background: #a0a0FF !important /* light-blue */
|
||||||
StatusLineExtended color: black !important; background: #a0FFa0 !important /* light-green */
|
StatusLineExtended;[dactyl|highlight] color: black !important; background: #a0FFa0 !important /* light-green */
|
||||||
|
|
||||||
TabClose;.tab-close-button
|
TabClose;.tab-close-button
|
||||||
TabIcon;.tab-icon min-width: 16px;
|
TabIcon;.tab-icon min-width: 16px;
|
||||||
|
|||||||
@@ -98,9 +98,15 @@ window[dactyl|highlight~=Bell] > * {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[dactyl|highlight~=CmdLine] {
|
[dactyl|highlight~=CmdLine] {
|
||||||
background: inherit !important;
|
/* background: inherit !important; */
|
||||||
color: 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] > [dactyl|highlight~=CmdLine] {
|
[dactyl|highlight~=CmdLine] > [dactyl|highlight~=CmdLine] {
|
||||||
padding: 0px !important;
|
padding: 0px !important;
|
||||||
@@ -131,11 +137,6 @@ statusbarpanel {
|
|||||||
background: transparent;
|
background: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dactyl-status-field-url {
|
|
||||||
background-color: inherit !important;
|
|
||||||
color: inherit !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* no longer at the window's bottom right corner */
|
/* no longer at the window's bottom right corner */
|
||||||
.statusbar-resizerpanel {
|
.statusbar-resizerpanel {
|
||||||
display: none;
|
display: none;
|
||||||
@@ -145,12 +146,12 @@ statusbarpanel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.dactyl-commandline-prompt {
|
.dactyl-commandline-prompt {
|
||||||
background-color: inherit;
|
/* background-color: inherit; */
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
}
|
}
|
||||||
.dactyl-commandline-command {
|
.dactyl-commandline-command {
|
||||||
background-color: inherit !important;
|
/* background-color: inherit !important; */
|
||||||
color: inherit !important;
|
color: inherit !important;
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user