Skip to content
This repository has been archived by the owner on Feb 25, 2023. It is now read-only.

Commit

Permalink
Merge pull request #7 from fuyufjh/master
Browse files Browse the repository at this point in the history
switch the logo color according to system theme
  • Loading branch information
joakimmag authored Jan 8, 2023
2 parents 0404ffb + 15716fe commit 7c4aa33
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
16 changes: 10 additions & 6 deletions src/Light Switch/Light Switch/Services/ThemeService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,14 @@ public void Reload()

private void SetLight()
{
NotifyIcon.Icon = Resources.Icon_LightMode;

var preferences = PreferencesService.GetPreferences();

if (preferences.IsAppThemeEnabled) SetAppTheme(true);
if (preferences.IsSystemThemeEnabled) SetSystemTheme(true);
if (preferences.IsSystemThemeEnabled)
{
SetSystemTheme(true);
NotifyIcon.Icon = Resources.Icon_LightMode;
}
if (preferences.IsWallpaperEnabled)
{
if (File.Exists(preferences.LightWallpaperPath))
Expand All @@ -66,12 +68,14 @@ private void SetLight()

private void SetDark()
{
NotifyIcon.Icon = Resources.Icon_DarkMode;

var preferences = PreferencesService.GetPreferences();

if (preferences.IsAppThemeEnabled) SetAppTheme(false);
if (preferences.IsSystemThemeEnabled) SetSystemTheme(false);
if (preferences.IsSystemThemeEnabled)
{
SetSystemTheme(false);
NotifyIcon.Icon = Resources.Icon_DarkMode;
}
if (preferences.IsWallpaperEnabled)
{
if (File.Exists(preferences.DarkWallpaperPath))
Expand Down
4 changes: 2 additions & 2 deletions src/Light Switch/Light Switch/Storage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ public bool Equals(FileInfo x, FileInfo y)
_ => null,
};

public static readonly Storage Wallpapers = new(nameof(Wallpapers));

/// <summary>
/// Path to LightSwitch storage in current user's temp folder.
/// </summary>
private static string BasePath { get; } = Path.Combine(Path.GetTempPath(), "LightSwitch");

public static readonly Storage Wallpapers = new(nameof(Wallpapers));

/// <summary>
/// Generates a unique string from current date and time.
/// </summary>
Expand Down

0 comments on commit 7c4aa33

Please sign in to comment.