mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-02 00:15:45 +01:00
Collapse the tab strip via CSS rather than the collapsed property to deal with the host tending to uncollapse it. Closes issue #37.
--HG-- extra : rebase_source : faa088b37377e1585421a2302f011b32493726ce
This commit is contained in:
@@ -31,7 +31,10 @@ const Tabs = Module("tabs", {
|
|||||||
// hide tabs initially to prevent flickering when 'stal' would hide them
|
// hide tabs initially to prevent flickering when 'stal' would hide them
|
||||||
// on startup
|
// on startup
|
||||||
if (config.hasTabbrowser)
|
if (config.hasTabbrowser)
|
||||||
config.tabStrip.collapsed = true; // FIXME: see 'stal' comment
|
config.tabStrip.collapsed = true;
|
||||||
|
|
||||||
|
this.tabStyle = styles.addSheet(true, "tab-strip-hiding", config.styleableChrome,
|
||||||
|
"", false, true)
|
||||||
|
|
||||||
dactyl.commands["tabs.select"] = function (event) {
|
dactyl.commands["tabs.select"] = function (event) {
|
||||||
tabs.select(event.originalTarget.getAttribute("identifier"));
|
tabs.select(event.originalTarget.getAttribute("identifier"));
|
||||||
@@ -983,24 +986,19 @@ const Tabs = Module("tabs", {
|
|||||||
"number", config.defaults["showtabline"],
|
"number", config.defaults["showtabline"],
|
||||||
{
|
{
|
||||||
setter: function (value) {
|
setter: function (value) {
|
||||||
// FIXME: we manipulate mTabContainer underneath mStrip so we
|
|
||||||
// don't have to fight against the host app's attempts to keep
|
|
||||||
// it open - hack! Adding a filter watch to mStrip is probably
|
|
||||||
// the cleanest solution.
|
|
||||||
let tabStrip = config.tabStrip;
|
let tabStrip = config.tabStrip;
|
||||||
|
|
||||||
if (value == 0)
|
if (value == 0) {
|
||||||
tabStrip.collapsed = true;
|
tabs.tabStyle.css = "#" + tabStrip.id + " { visibility: collapse; }"
|
||||||
|
tabs.tabStyle.enabled = true;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
// FIXME: Why are we preferring our own created preference
|
options.safeSetPref("browser.tabs.autoHide", value == 1,
|
||||||
// here? --djk
|
"See 'showtabline' option.");
|
||||||
let pref = "browser.tabStrip.autoHide";
|
tabs.tabStyle.enabled = false;
|
||||||
if (options.getPref(pref) == null) // Try for FF 3.0 & 3.1
|
|
||||||
pref = "browser.tabs.autoHide";
|
|
||||||
options.safeSetPref(pref, value == 1, "See 'showtabline' option.");
|
|
||||||
tabStrip.collapsed = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tabStrip.collapsed = false;
|
||||||
return value;
|
return value;
|
||||||
},
|
},
|
||||||
completer: function (context) [
|
completer: function (context) [
|
||||||
|
|||||||
Reference in New Issue
Block a user