Skip to content

Commit

Permalink
GameMode: Show tray icon if all skins are unloaded
Browse files Browse the repository at this point in the history
  • Loading branch information
brianferguson committed Jan 5, 2023
1 parent 634a956 commit bb762eb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
2 changes: 2 additions & 0 deletions Library/GameMode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,8 @@ void GameMode::EnterGameMode()
rainmeter.DeleteAllSkins();
rainmeter.DeleteAllUnmanagedSkins(); // Redelete unmanaged windows caused by OnCloseAction

rainmeter.ShowTrayIconIfNecessary();

m_State = State::Enabled;
}
else
Expand Down
14 changes: 9 additions & 5 deletions Library/Rainmeter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1187,11 +1187,7 @@ void Rainmeter::DeactivateSkin(Skin* skin, int folderIndex, bool save)

skin->Deactivate();

// Show tray icon if no skins are active
if (m_Skins.empty())
{
m_TrayIcon->SetTrayIcon(true, true);
}
ShowTrayIconIfNecessary();
}
}

Expand Down Expand Up @@ -2238,3 +2234,11 @@ void Rainmeter::CheckSettingsFileEncoding(const std::wstring& iniFile, std::wstr
}
}
}

void Rainmeter::ShowTrayIconIfNecessary()
{
if (m_Skins.empty()) // Show tray icon if no skins are active
{
m_TrayIcon->SetTrayIcon(true, true);
}
}
2 changes: 2 additions & 0 deletions Library/Rainmeter.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ class Rainmeter
void TestSettingsFile(bool bDefaultIniLocation);
void CheckSettingsFileEncoding(const std::wstring& iniFile, std::wstring* log);

void ShowTrayIconIfNecessary();

TrayIcon* m_TrayIcon;

std::multimap<int, int> m_SkinOrders;
Expand Down

0 comments on commit bb762eb

Please sign in to comment.