New: Auto theme option to match OS theme
Co-authored-by: Qstick <qstick@gmail.com>
This commit is contained in:
parent
c7d6c0f452
commit
4ca5a213fa
|
@ -177,7 +177,7 @@ class UISettings extends Component {
|
||||||
<FormInputGroup
|
<FormInputGroup
|
||||||
type={inputTypes.SELECT}
|
type={inputTypes.SELECT}
|
||||||
name="theme"
|
name="theme"
|
||||||
helpText="Change Application UI Theme, Inspired by Theme.Park"
|
helpText="Change Application UI Theme, 'Auto' Theme will use your OS Theme to set Light or Dark mode. Inspired by Theme.Park"
|
||||||
values={themeOptions}
|
values={themeOptions}
|
||||||
onChange={onInputChange}
|
onChange={onInputChange}
|
||||||
{...settings.theme}
|
{...settings.theme}
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
import * as dark from './dark';
|
import * as dark from './dark';
|
||||||
import * as light from './light';
|
import * as light from './light';
|
||||||
|
|
||||||
|
const defaultDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
|
||||||
|
const auto = defaultDark ? { ...dark } : { ...light };
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
auto,
|
||||||
light,
|
light,
|
||||||
dark
|
dark
|
||||||
};
|
};
|
||||||
|
|
|
@ -191,7 +191,7 @@ namespace NzbDrone.Core.Configuration
|
||||||
public string LogLevel => GetValue("LogLevel", "info").ToLowerInvariant();
|
public string LogLevel => GetValue("LogLevel", "info").ToLowerInvariant();
|
||||||
public string ConsoleLogLevel => GetValue("ConsoleLogLevel", string.Empty, persist: false);
|
public string ConsoleLogLevel => GetValue("ConsoleLogLevel", string.Empty, persist: false);
|
||||||
|
|
||||||
public string Theme => GetValue("Theme", "light", persist: false);
|
public string Theme => GetValue("Theme", "auto", persist: false);
|
||||||
public bool LogSql => GetValueBoolean("LogSql", false, persist: false);
|
public bool LogSql => GetValueBoolean("LogSql", false, persist: false);
|
||||||
public int LogRotate => GetValueInt("LogRotate", 50, persist: false);
|
public int LogRotate => GetValueInt("LogRotate", 50, persist: false);
|
||||||
public bool FilterSentryEvents => GetValueBoolean("FilterSentryEvents", true, persist: false);
|
public bool FilterSentryEvents => GetValueBoolean("FilterSentryEvents", true, persist: false);
|
||||||
|
|
Loading…
Reference in New Issue