mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2025-05-11 18:36:45 +02:00
Simplify
This commit is contained in:
parent
7a69c87b56
commit
b12be796c7
1 changed files with 6 additions and 14 deletions
|
@ -59,13 +59,9 @@ public class App : Application, IDisposable
|
|||
{
|
||||
RequestedThemeVariant = _settingsService.Theme switch
|
||||
{
|
||||
ThemeVariant.System => Avalonia.Styling.ThemeVariant.Default,
|
||||
ThemeVariant.Light => Avalonia.Styling.ThemeVariant.Light,
|
||||
ThemeVariant.Dark => Avalonia.Styling.ThemeVariant.Dark,
|
||||
_
|
||||
=> throw new InvalidOperationException(
|
||||
$"Unknown theme '{_settingsService.Theme}'."
|
||||
)
|
||||
_ => Avalonia.Styling.ThemeVariant.Default
|
||||
};
|
||||
|
||||
InitializeTheme();
|
||||
|
@ -91,17 +87,13 @@ public class App : Application, IDisposable
|
|||
{
|
||||
"Light" => PlatformThemeVariant.Light,
|
||||
"Dark" => PlatformThemeVariant.Dark,
|
||||
_ => PlatformSettings?.GetColorValues().ThemeVariant
|
||||
_ => PlatformSettings?.GetColorValues().ThemeVariant ?? PlatformThemeVariant.Light
|
||||
};
|
||||
|
||||
this.LocateMaterialTheme<MaterialThemeBase>().CurrentTheme = actualTheme switch
|
||||
{
|
||||
PlatformThemeVariant.Light
|
||||
=> Theme.Create(Theme.Light, Color.Parse("#343838"), Color.Parse("#F9A825")),
|
||||
PlatformThemeVariant.Dark
|
||||
=> Theme.Create(Theme.Dark, Color.Parse("#E8E8E8"), Color.Parse("#F9A825")),
|
||||
_ => throw new InvalidOperationException($"Unknown theme '{actualTheme}'.")
|
||||
};
|
||||
this.LocateMaterialTheme<MaterialThemeBase>().CurrentTheme =
|
||||
actualTheme == PlatformThemeVariant.Light
|
||||
? Theme.Create(Theme.Light, Color.Parse("#343838"), Color.Parse("#F9A825"))
|
||||
: Theme.Create(Theme.Dark, Color.Parse("#E8E8E8"), Color.Parse("#F9A825"));
|
||||
}
|
||||
|
||||
public override void OnFrameworkInitializationCompleted()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue