New: Auto theme option to match OS theme

Co-authored-by: Qstick <qstick@gmail.com>
This commit is contained in:
Zak Saunders 2022-12-06 07:22:52 +00:00 committed by GitHub
parent c7d6c0f452
commit 4ca5a213fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 2 deletions

View File

@ -177,7 +177,7 @@ class UISettings extends Component {
<FormInputGroup
type={inputTypes.SELECT}
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}
onChange={onInputChange}
{...settings.theme}

View File

@ -1,7 +1,11 @@
import * as dark from './dark';
import * as light from './light';
const defaultDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
const auto = defaultDark ? { ...dark } : { ...light };
export default {
auto,
light,
dark
};

View File

@ -191,7 +191,7 @@ namespace NzbDrone.Core.Configuration
public string LogLevel => GetValue("LogLevel", "info").ToLowerInvariant();
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 int LogRotate => GetValueInt("LogRotate", 50, persist: false);
public bool FilterSentryEvents => GetValueBoolean("FilterSentryEvents", true, persist: false);