diff --git a/js/actions/windowActions.js b/js/actions/windowActions.js index 2878948a432..797f72c0357 100644 --- a/js/actions/windowActions.js +++ b/js/actions/windowActions.js @@ -1198,6 +1198,20 @@ const windowActions = { tabId, notify }) + }, + + onTabClose: function (data) { + dispatch({ + actionType: windowConstants.WINDOW_TAB_CLOSE, + data + }) + }, + + onTabMouseLeave: function (data) { + dispatch({ + actionType: windowConstants.WINDOW_TAB_MOUSE_LEAVE, + data + }) } } diff --git a/js/components/main.js b/js/components/main.js index 9bcf83ec46b..35f1cc1b571 100644 --- a/js/components/main.js +++ b/js/components/main.js @@ -1180,6 +1180,7 @@ class Main extends ImmutableComponent { tabsPerTabPage={tabsPerPage} tabPageIndex={this.props.windowState.getIn(['ui', 'tabs', 'tabPageIndex'])} previewTabPageIndex={this.props.windowState.getIn(['ui', 'tabs', 'previewTabPageIndex'])} + fixTabWidth={this.props.windowState.getIn(['ui', 'tabs', 'fixTabWidth'])} tabs={this.props.windowState.get('tabs')} sites={appStateSites} key='tab-bar' diff --git a/js/components/tab.js b/js/components/tab.js index 20ef799e872..21e04505349 100644 --- a/js/components/tab.js +++ b/js/components/tab.js @@ -105,6 +105,7 @@ class Tab extends ImmutableComponent { onCloseFrame (event) { event.stopPropagation() + this.props.onFrameClose(this.tabNode.parentNode.getBoundingClientRect()) windowActions.closeFrame(windowStore.getFrames(), this.frame) } @@ -196,8 +197,9 @@ class Tab extends ImmutableComponent { draggingOverRight: this.isDraggingOverRight, isDragging: this.isDragging, isPinned: this.isPinned, - partOfFullPageSet: this.props.partOfFullPageSet + partOfFullPageSet: this.props.partOfFullPageSet || !!this.props.tabWidth })} + style={this.props.tabWidth ? { flex: `0 0 ${this.props.tabWidth}px` } : {}} onMouseEnter={this.props.previewTabs ? this.onMouseEnter : null} onMouseLeave={this.props.previewTabs ? this.onMouseLeave : null}>