mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-13 04:28:41 -09:00
hyperterm: implement font size config
This commit is contained in:
parent
fcb221456d
commit
043c9c86da
1 changed files with 9 additions and 3 deletions
|
|
@ -7,7 +7,7 @@ import shallowCompare from 'react-addons-shallow-compare';
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
|
|
||||||
export default class HyperTerm extends Component {
|
export default class HyperTerm extends Component {
|
||||||
constructor () {
|
constructor (props) {
|
||||||
super();
|
super();
|
||||||
this.state = {
|
this.state = {
|
||||||
cols: null,
|
cols: null,
|
||||||
|
|
@ -24,7 +24,7 @@ export default class HyperTerm extends Component {
|
||||||
fontSizeIndicatorShowing: false,
|
fontSizeIndicatorShowing: false,
|
||||||
dismissedUpdate: false,
|
dismissedUpdate: false,
|
||||||
updateVersion: null,
|
updateVersion: null,
|
||||||
fontSize: 12
|
fontSize: props.config.fontSize
|
||||||
};
|
};
|
||||||
|
|
||||||
// we set this to true when the first tab
|
// we set this to true when the first tab
|
||||||
|
|
@ -56,6 +56,12 @@ export default class HyperTerm extends Component {
|
||||||
this.onUpdateAvailable = this.onUpdateAvailable.bind(this);
|
this.onUpdateAvailable = this.onUpdateAvailable.bind(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
componentWillReceiveProps (props) {
|
||||||
|
if (props.config.fontSize !== this.props.config.fontSize) {
|
||||||
|
this.changeFontSize(props.config.fontSize);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
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 }) }>
|
||||||
|
|
@ -328,7 +334,7 @@ export default class HyperTerm extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
resetFontSize () {
|
resetFontSize () {
|
||||||
this.changeFontSize(12);
|
this.changeFontSize(this.props.config.fontSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
increaseFontSize () {
|
increaseFontSize () {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue