Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Add support for 100 tabs
Browse files Browse the repository at this point in the history
Fix #6692

Auditors: @bbondy, @bsclifton
  • Loading branch information
cezaraugusto committed Mar 14, 2017
1 parent 0919732 commit 9e148d2
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 6 deletions.
1 change: 1 addition & 0 deletions app/renderer/components/styles/tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ const styles = StyleSheet.create({
},

tabId: {
justifyContent: 'center',
alignItems: 'center',
display: 'flex',
flex: '1',
Expand Down
6 changes: 3 additions & 3 deletions app/renderer/components/tabContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class Favicon extends ImmutableComponent {
className={css(
styles.icon,
this.favicon && iconStyles.favicon,
this.narrowView && styles.faviconNarrowView
!this.props.tabProps.get('pinnedLocation') && this.narrowView && styles.faviconNarrowView
)}
symbol={this.loadingIcon || this.defaultIcon} />
: null
Expand Down Expand Up @@ -283,9 +283,9 @@ const styles = StyleSheet.create({
},

faviconNarrowView: {
minWidth: globalStyles.spacing.narrowIconSize,
minWidth: 'auto',
width: globalStyles.spacing.narrowIconSize,
backgroundSize: globalStyles.spacing.narrowIconSize,
backgroundSize: 'contain',
padding: '0',
fontSize: '10px',
backgroundPosition: 'center center'
Expand Down
2 changes: 1 addition & 1 deletion js/about/preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ class TabsTab extends ImmutableComponent {
onChange={changeSetting.bind(null, this.props.onChangeSetting, settings.TABS_PER_PAGE)}>
{
// Sorry, Brad says he hates primes :'(
[6, 8, 10, 20].map((x) =>
[6, 8, 10, 20, 100].map((x) =>

This comment has been minimized.

Copy link
@bbondy

bbondy Mar 14, 2017

Member

100?! Not surprised, @bradleyrichter you're still at it with your fight against primes.

<option value={x} key={x}>{x}</option>)
}
</SettingDropdown>
Expand Down
8 changes: 7 additions & 1 deletion js/components/tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ class Tab extends ImmutableComponent {
}

componentDidUpdate () {
this.tabSize
this.onUpdateTabSize()
}

Expand All @@ -217,6 +216,13 @@ class Tab extends ImmutableComponent {
window.removeEventListener('resize', this.onUpdateTabSize)
}

componentWillReceiveProps (nextProps) {
// Update breakpoint each time a new tab is open
if (this.props.totalTabs !== nextProps.totalTabs) {
this.onUpdateTabSize()
}
}

render () {
const perPageStyles = StyleSheet.create({
themeColor: {
Expand Down
1 change: 1 addition & 0 deletions js/components/tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ class Tabs extends ImmutableComponent {
onTabClosedWithMouse={this.onTabClosedWithMouse}
tabWidth={this.props.fixTabWidth}
hasTabInFullScreen={this.props.hasTabInFullScreen}
totalTabs={this.props.tabs.size}
partOfFullPageSet={this.props.partOfFullPageSet} />)
}
{(() => {
Expand Down
2 changes: 1 addition & 1 deletion js/constants/appConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ module.exports = {
'search.offer-search-suggestions': false, // false by default for privacy reasons
'tabs.switch-to-new-tabs': false,
'tabs.paint-tabs': true,
'tabs.tabs-per-page': 10,
'tabs.tabs-per-page': 20,
'tabs.close-action': 'parent',
'tabs.show-tab-previews': true,
'tabs.show-dashboard-images': true,
Expand Down

0 comments on commit 9e148d2

Please sign in to comment.