Skip to content

Commit

Permalink
Merge pull request kdashg#1 from alexander255/master
Browse files Browse the repository at this point in the history
Add option to hide tab bar in fullscreen mode
  • Loading branch information
kdashg committed Oct 14, 2015
2 parents 7167cbd + a889f75 commit 4c0e9c0
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ const DEFAULT_PREFS = {
"extensions.verticaltabs.right": false,
"extensions.verticaltabs.tabsOnTop": false,
"browser.tabs.drawInTitlebar": false,
"extensions.verticaltabs.theme": 'default'
"extensions.verticaltabs.theme": 'default',
"extensions.verticaltabs.fullscreen": true
};

/**
Expand Down
3 changes: 3 additions & 0 deletions options.xul
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@
</menupopup>
</menulist>
</setting>
<setting type="bool"
pref="extensions.verticaltabs.fullscreen"
title="Hide tabs in fullscreen mode"/>
</vbox>
21 changes: 21 additions & 0 deletions verticaltabs.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,11 @@ VerticalTabs.prototype = {

this.window.addEventListener("resize", this, false);

this.window.addEventListener("sizemodechange", this, true);

this.unloaders.push(function () {
this.window.removeEventListener("sizemodechange", this, true);

// Move the bottom back to being the next sibling of contentbox.
browserbox.insertBefore(bottom, contentbox.nextSibling);

Expand Down Expand Up @@ -241,6 +245,19 @@ VerticalTabs.prototype = {
aTab.maxWidth = 65000;
aTab.minWidth = 0;
},

onSizeModeChange: function(aEvent) {
let box = this.document.getElementById("verticaltabs-box");
let splitter = this.document.getElementById("verticaltabs-splitter");
if(this.window.windowState == 4
&& Services.prefs.getBoolPref("extensions.verticaltabs.fullscreen")) {
box.style.display = 'none';
splitter.style.display = 'none';
} else {
box.style.display = '';
splitter.style.display = '';
}
},

setPinnedSizes: function() {
let tabs = this.document.getElementById("tabbrowser-tabs");
Expand Down Expand Up @@ -333,6 +350,10 @@ VerticalTabs.prototype = {
case "resize":
this.setPinnedSizes();
return;

case "sizemodechange":
this.onSizeModeChange(aEvent);
return;
}
},
};

0 comments on commit 4c0e9c0

Please sign in to comment.