Skip to content

Commit

Permalink
Implement max number of tab rows (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
numirias committed Jun 8, 2020
1 parent c54a605 commit 8c1e9a7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
web-ext-artifacts/
TODO
NOTES
play/
build/
2 changes: 2 additions & 0 deletions src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export let defaultOptions = {
minTabSize: 150,
maxTabSize: 300,
minTabHeight: 28,
maxTabRows: 99,
minLightness: 59,
maxLightness: 100,
fitLightness: true,
Expand Down Expand Up @@ -43,6 +44,7 @@ function makeDynamicSheet(options) {
--paxmod-min-tab-size: ${options.minTabSize}px;
--paxmod-max-tab-size: ${options.maxTabSize}px;
--tab-min-height: ${options.minTabHeight}px !important;
--paxmod-max-tab-rows: ${options.maxTabRows} !important;
--paxmod-font-family: ${options.fontFamily};
--paxmod-display-newtab: ${options.displayNewtab ? '-webkit-box' : 'none'};
--paxmod-titlebar-display: ${options.displayTitlebar ? '-webkit-box' : 'none'};
Expand Down
4 changes: 4 additions & 0 deletions src/browser.css
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ toolbarbutton#tabs-newtab-button {
width: 100% !important;
display: flex !important;
flex-wrap: wrap !important;
max-height: calc(var(--tab-min-height) * var(--paxmod-max-tab-rows)) !important;
overflow-y: auto !important;
scrollbar-width: thin !important;
scrollbar-color: var(--toolbarbutton-active-background) transparent;
}

#tabbrowser-arrowscrollbox::part(arrowscrollbox-overflow-start-indicator),
Expand Down
3 changes: 3 additions & 0 deletions src/options/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ <h1>Settings</h1>
<div><label for="minTabHeight">Min. tab height</label></div>
<div><input id="minTabHeight" type="number"> px</div>

<div><label for="maxTabRows">Max. number of tab rows <small>(before scrollbar appears)</small></label></div>
<div><input id="maxTabRows" type="number"></div>

<div><label for="fitLightness">Fit lightness to themes</label></div>
<div><input id="fitLightness" type="checkbox"></div>

Expand Down

0 comments on commit 8c1e9a7

Please sign in to comment.