|
@ -1,14 +1,15 @@ |
|
|
import React, { useRef, useState } from 'react'; |
|
|
import React, { useRef, useState } from 'react'; |
|
|
|
|
|
import { shell } from 'electron'; |
|
|
import settings from 'electron-settings'; |
|
|
import settings from 'electron-settings'; |
|
|
import { RadioGroup, ControlLabel, Nav } from 'rsuite'; |
|
|
import { ControlLabel, Nav, Icon } from 'rsuite'; |
|
|
import { ConfigPanel } from '../styled'; |
|
|
import { ConfigPanel } from '../styled'; |
|
|
import { |
|
|
import { |
|
|
StyledRadio, |
|
|
|
|
|
StyledInputPicker, |
|
|
StyledInputPicker, |
|
|
StyledNavItem, |
|
|
StyledNavItem, |
|
|
StyledInputNumber, |
|
|
StyledInputNumber, |
|
|
StyledCheckbox, |
|
|
StyledCheckbox, |
|
|
StyledInputPickerContainer, |
|
|
StyledInputPickerContainer, |
|
|
|
|
|
StyledLink, |
|
|
} from '../../shared/styled'; |
|
|
} from '../../shared/styled'; |
|
|
import ListViewConfig from './ListViewConfig'; |
|
|
import ListViewConfig from './ListViewConfig'; |
|
|
import { Fonts } from '../Fonts'; |
|
|
import { Fonts } from '../Fonts'; |
|
@ -37,9 +38,10 @@ const LookAndFeelConfig = () => { |
|
|
const [highlightOnRowHoverChk, setHighlightOnRowHoverChk] = useState( |
|
|
const [highlightOnRowHoverChk, setHighlightOnRowHoverChk] = useState( |
|
|
Boolean(settings.getSync('highlightOnRowHover')) |
|
|
Boolean(settings.getSync('highlightOnRowHover')) |
|
|
); |
|
|
); |
|
|
|
|
|
const themePickerContainerRef = useRef(null); |
|
|
const fontPickerContainerRef = useRef(null); |
|
|
const fontPickerContainerRef = useRef(null); |
|
|
const titleBarPickerContainerRef = useRef(null); |
|
|
const titleBarPickerContainerRef = useRef(null); |
|
|
|
|
|
const themes: any = settings.getSync('themes'); |
|
|
const songCols: any = settings.getSync('musicListColumns'); |
|
|
const songCols: any = settings.getSync('musicListColumns'); |
|
|
const albumCols: any = settings.getSync('albumListColumns'); |
|
|
const albumCols: any = settings.getSync('albumListColumns'); |
|
|
const playlistCols: any = settings.getSync('playlistListColumns'); |
|
|
const playlistCols: any = settings.getSync('playlistListColumns'); |
|
@ -56,23 +58,31 @@ const LookAndFeelConfig = () => { |
|
|
return ( |
|
|
return ( |
|
|
<> |
|
|
<> |
|
|
<ConfigPanel header="Look & Feel" bordered> |
|
|
<ConfigPanel header="Look & Feel" bordered> |
|
|
<div style={{ width: '300px' }}> |
|
|
<p> |
|
|
<p>Select the main application theme.</p> |
|
|
<StyledLink |
|
|
<RadioGroup |
|
|
onClick={() => shell.openExternal('https://github.com/jeffvli/sonixd/discussions/61')} |
|
|
name="themeRadioList" |
|
|
> |
|
|
appearance="default" |
|
|
Check out the theming documentation! <Icon icon="external-link" /> |
|
|
|
|
|
</StyledLink> |
|
|
|
|
|
</p> |
|
|
|
|
|
<br /> |
|
|
|
|
|
<StyledInputPickerContainer ref={themePickerContainerRef}> |
|
|
|
|
|
<ControlLabel>Application theme</ControlLabel> |
|
|
|
|
|
<br /> |
|
|
|
|
|
<StyledInputPicker |
|
|
|
|
|
container={() => themePickerContainerRef.current} |
|
|
|
|
|
data={themes} |
|
|
|
|
|
labelKey="label" |
|
|
|
|
|
valueKey="value" |
|
|
|
|
|
cleanable={false} |
|
|
defaultValue={String(settings.getSync('theme'))} |
|
|
defaultValue={String(settings.getSync('theme'))} |
|
|
onChange={(e) => { |
|
|
onChange={(e: string) => { |
|
|
settings.setSync('theme', e); |
|
|
settings.setSync('theme', e); |
|
|
dispatch(setTheme(e)); |
|
|
dispatch(setTheme(e)); |
|
|
}} |
|
|
}} |
|
|
> |
|
|
/> |
|
|
<StyledRadio value="defaultDark">Default Dark</StyledRadio> |
|
|
</StyledInputPickerContainer> |
|
|
<StyledRadio value="defaultLight">Default Light</StyledRadio> |
|
|
|
|
|
</RadioGroup> |
|
|
|
|
|
</div> |
|
|
|
|
|
<br /> |
|
|
<br /> |
|
|
|
|
|
|
|
|
<StyledInputPickerContainer ref={fontPickerContainerRef}> |
|
|
<StyledInputPickerContainer ref={fontPickerContainerRef}> |
|
|
<ControlLabel>Font</ControlLabel> |
|
|
<ControlLabel>Font</ControlLabel> |
|
|
<br /> |
|
|
<br /> |
|
|