Skip to content

Commit

Permalink
add configurable uifontfamily (#1549)
Browse files Browse the repository at this point in the history
* add configurable uifontfamily

* rm uifontfamily config default

* fix uifontfamily conf default
  • Loading branch information
Henrik authored and rauchg committed Feb 18, 2017
1 parent 21bd2a7 commit ade9ad3
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 11 deletions.
6 changes: 1 addition & 5 deletions lib/components/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,7 @@ export default class Header extends Component {
},

appTitle: {
fontSize: '12px',
fontFamily: `-apple-system, BlinkMacSystemFont,
"Segoe UI", "Roboto", "Oxygen",
"Ubuntu", "Cantarell", "Fira Sans",
"Droid Sans", "Helvetica Neue", sans-serif`
fontSize: '12px'
},

shape: {
Expand Down
4 changes: 0 additions & 4 deletions lib/components/tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,6 @@ export default class Tabs extends Component {
return {
nav: {
fontSize: '12px',
fontFamily: `-apple-system, BlinkMacSystemFont,
"Segoe UI", "Roboto", "Oxygen",
"Ubuntu", "Cantarell", "Fira Sans",
"Droid Sans", "Helvetica Neue", sans-serif`,
height: '34px',
lineHeight: '34px',
verticalAlign: 'middle',
Expand Down
1 change: 1 addition & 0 deletions lib/components/term-group.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class TermGroup_ extends Component {
cursorShape: this.props.cursorShape,
cursorBlink: this.props.cursorBlink,
fontFamily: this.props.fontFamily,
uiFontFamily: this.props.uiFontFamily,
fontSmoothing: this.props.fontSmoothing,
foregroundColor: this.props.foregroundColor,
backgroundColor: this.props.backgroundColor,
Expand Down
1 change: 1 addition & 0 deletions lib/components/terms.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export default class Terms extends Component {
cursorShape: this.props.cursorShape,
cursorBlink: this.props.cursorBlink,
fontFamily: this.props.fontFamily,
uiFontFamily: this.props.uiFontFamily,
fontSmoothing: this.props.fontSmoothing,
foregroundColor: this.props.foregroundColor,
backgroundColor: this.props.backgroundColor,
Expand Down
5 changes: 3 additions & 2 deletions lib/containers/hyper.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ class Hyper extends Component {
}

template(css) {
const {isMac, customCSS, borderColor, maximized} = this.props;
const {isMac, customCSS, uiFontFamily, borderColor, maximized} = this.props;
const borderWidth = isMac ? '' :
`${maximized ? '0' : '1'}px`;

return (<div>
<div
style={{borderColor, borderWidth}}
style={{fontFamily: uiFontFamily, borderColor, borderWidth}}
className={css('main', isMac && 'mainRounded')}
>
<HeaderContainer/>
Expand Down Expand Up @@ -140,6 +140,7 @@ const HyperContainer = connect(
return {
isMac,
customCSS: state.ui.css,
uiFontFamily: state.ui.uiFontFamily,
borderColor: state.ui.borderColor,
activeSession: state.sessions.activeUid,
backgroundColor: state.ui.backgroundColor,
Expand Down
1 change: 1 addition & 0 deletions lib/containers/terms.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const TermsContainer = connect(
state.ui.fontSizeOverride :
state.ui.fontSize,
fontFamily: state.ui.fontFamily,
uiFontFamily: state.ui.uiFontFamily,
fontSmoothing: state.ui.fontSmoothingOverride,
padding: state.ui.padding,
cursorColor: state.ui.cursorColor,
Expand Down
5 changes: 5 additions & 0 deletions lib/reducers/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const initial = Immutable({
fontSize: 12,
padding: '12px 14px',
fontFamily: 'Menlo, "DejaVu Sans Mono", "Lucida Console", monospace',
uiFontFamily: null,
fontSizeOverride: null,
fontSmoothingOverride: 'antialiased',
css: '',
Expand Down Expand Up @@ -119,6 +120,10 @@ const reducer = (state = initial, action) => {
ret.fontFamily = config.fontFamily;
}

if (config.uiFontFamily) {
ret.uiFontFamily = config.uiFontFamily;
}

if (config.cursorColor) {
ret.cursorColor = config.cursorColor;
}
Expand Down
6 changes: 6 additions & 0 deletions website/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,12 @@ <h2 id="cfg"><a href="#cfg">Configuration</a></h2>
<td>"Menlo, DejaVu Sans Mono, Lucida Console, monospace"</td>
<td>The font family to use with optional fallbacks</td>
</tr>
<tr>
<td>"uiFontFamily"</td>
<td>"-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, ..."</td>
<td>The font family to use for the UI with optional fallbacks</td>
</tr>
<tr>
<tr>
<td>"cursorColor"</td>
<td>"#F81CE5"</td>
Expand Down

0 comments on commit ade9ad3

Please sign in to comment.