hyperterm: set global background color

This commit is contained in:
Guillermo Rauch 2016-07-07 17:25:56 -07:00
parent d17784f962
commit 9aff04acf3

View file

@ -54,18 +54,25 @@ export default class HyperTerm extends Component {
this.dismissUpdate = this.dismissUpdate.bind(this); this.dismissUpdate = this.dismissUpdate.bind(this);
this.onUpdateAvailable = this.onUpdateAvailable.bind(this); this.onUpdateAvailable = this.onUpdateAvailable.bind(this);
document.body.style.backgroundColor = props.config.backgroundColor;
} }
componentWillReceiveProps (props) { componentWillReceiveProps (props) {
if (props.config.fontSize !== this.props.config.fontSize) { if (props.config.fontSize !== this.props.config.fontSize) {
this.changeFontSize(props.config.fontSize); this.changeFontSize(props.config.fontSize);
} }
if (props.config.backgroundColor !== this.props.config.backgroundColor) {
document.body.style.backgroundColor = props.config.backgroundColor;
}
} }
render () { render () {
const { backgroundColor } = this.props.config;
return <div onClick={ this.focusActive }> return <div onClick={ this.focusActive }>
<div className={ classes('main', { mac: this.state.mac }) }> <div className={ classes('main', { mac: this.state.mac }) }>
<header onMouseDown={this.onHeaderMouseDown}> <header style={{ backgroundColor }} onMouseDown={this.onHeaderMouseDown}>
<Tabs <Tabs
active={this.state.active} active={this.state.active}
activeMarkers={this.state.activeMarkers} activeMarkers={this.state.activeMarkers}