|
|
@ -1,4 +1,5 @@
|
|
|
|
import React from 'react'
|
|
|
|
import React from 'react'
|
|
|
|
|
|
|
|
import Toggle from './Toggle'
|
|
|
|
import { None, BW, Sharp, Boxy } from './svg/WindowThemes'
|
|
|
|
import { None, BW, Sharp, Boxy } from './svg/WindowThemes'
|
|
|
|
import { COLORS } from '../lib/constants'
|
|
|
|
import { COLORS } from '../lib/constants'
|
|
|
|
|
|
|
|
|
|
|
@ -7,7 +8,7 @@ const WINDOW_THEMES_MAP = { none: None, sharp: Sharp, bw: BW, boxy: Boxy }
|
|
|
|
class ThemeSelect extends React.Component {
|
|
|
|
class ThemeSelect extends React.Component {
|
|
|
|
select = theme => {
|
|
|
|
select = theme => {
|
|
|
|
if (this.props.selected !== theme) {
|
|
|
|
if (this.props.selected !== theme) {
|
|
|
|
this.props.onChange(theme)
|
|
|
|
this.props.onChange('windowTheme', theme)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -54,25 +55,27 @@ class ThemeSelect extends React.Component {
|
|
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
|
|
|
|
<>
|
|
|
|
<div className="window-theme">
|
|
|
|
<div className="window-theme">
|
|
|
|
<span className="label" id="window-theme-label">
|
|
|
|
<Toggle
|
|
|
|
Theme
|
|
|
|
label="Window controls"
|
|
|
|
</span>
|
|
|
|
enabled={this.props.windowControls}
|
|
|
|
|
|
|
|
onChange={v => this.props.onChange('windowControls', v)}
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
{this.props.windowControls && (
|
|
|
|
<div className="themes" role="radiogroup" aria-labelledby="window-theme-label">
|
|
|
|
<div className="themes" role="radiogroup" aria-labelledby="window-theme-label">
|
|
|
|
{this.renderThemes()}
|
|
|
|
{this.renderThemes()}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
)}
|
|
|
|
<style jsx>
|
|
|
|
<style jsx>
|
|
|
|
{`
|
|
|
|
{`
|
|
|
|
.window-theme {
|
|
|
|
|
|
|
|
padding: 8px;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.window-theme span {
|
|
|
|
.window-theme span {
|
|
|
|
display: inline-block;
|
|
|
|
display: inline-block;
|
|
|
|
margin-bottom: 2px;
|
|
|
|
margin-bottom: 2px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.themes {
|
|
|
|
.themes {
|
|
|
|
|
|
|
|
padding: 4px 8px 8px;
|
|
|
|
display: flex;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
flex-direction: row;
|
|
|
|
width: 100%;
|
|
|
|
width: 100%;
|
|
|
@ -82,6 +85,7 @@ class ThemeSelect extends React.Component {
|
|
|
|
`}
|
|
|
|
`}
|
|
|
|
</style>
|
|
|
|
</style>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</>
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|