From: lx-s Date: Sat, 16 Dec 2023 23:02:04 +0000 (+0100) Subject: Tried to rework icons a bit X-Git-Tag: 2.4.9.0~71 X-Git-Url: https://repos.lx-s.de/gitweb/?a=commitdiff_plain;h=6088ef997230c507a00bad1572258faef19d3066;p=winmute.git Tried to rework icons a bit --- diff --git a/WinMute/WinMute.cpp b/WinMute/WinMute.cpp index b5e79b0..8b7a5d4 100644 --- a/WinMute/WinMute.cpp +++ b/WinMute/WinMute.cpp @@ -67,43 +67,6 @@ static LRESULT CALLBACK WinMuteWndProc( : DefWindowProcW(hWnd, msg, wParam, lParam); } -static int IsDarkMode(bool& isDarkMode) -{ - WMLog &log = WMLog::GetInstance(); - HKEY hKey; - int rc = 1; - //RegOpenCurrentUser - const std::wstring regKey = - L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"; - LSTATUS error = RegOpenKeyW( - HKEY_CURRENT_USER, - regKey.c_str(), - &hKey); - if (error != ERROR_SUCCESS) { - PrintWindowsError(L"RegOpenKey", error); - log.Write(L"[Registry] Failed to open registry key \"%s\"", regKey.c_str()); - } else { - DWORD isLightTheme = 0; - DWORD bufSize = sizeof(isLightTheme); - DWORD valType = 0; - error = RegQueryValueExW( - hKey, - L"SystemUsesLightTheme", - nullptr, - &valType, - reinterpret_cast(&isLightTheme), - &bufSize); - if (error != ERROR_SUCCESS) { - log.Write(L"[Registry] Failed to query value for key \"SystemUsesLightTheme\""); - } else { - isDarkMode = !isLightTheme; - rc = 0; - } - RegCloseKey(hKey); - } - return rc; -} - static bool IsCurrentSessionRemoteable() noexcept { bool isRemoteable = false; @@ -271,12 +234,7 @@ bool WinMute::Init() return false; } - bool isDarkMode = true; - IsDarkMode(isDarkMode); - hTrayIcon_ = LoadIconW( - hglobInstance, - isDarkMode ? MAKEINTRESOURCE(IDI_TRAY_DARK) - : MAKEINTRESOURCE(IDI_TRAY_BRIGHT)); + hTrayIcon_ = LoadIconW(hglobInstance, MAKEINTRESOURCE(IDI_APP)); if (hTrayIcon_ == nullptr) { PrintWindowsError(_T("LoadIcon")); return false; @@ -533,22 +491,8 @@ LRESULT WinMute::OnTrayIcon(HWND hWnd, WPARAM, LPARAM lParam) return TRUE; } -LRESULT WinMute::OnSettingChange(HWND, WPARAM, LPARAM lParam) +LRESULT WinMute::OnSettingChange(HWND, WPARAM, LPARAM) { - const wchar_t *changeParam = reinterpret_cast(lParam); - if (changeParam != nullptr && wcscmp(changeParam, L"ImmersiveColorSet") == 0) { - bool isDarkMode = true; - IsDarkMode(isDarkMode); - hTrayIcon_ = LoadIconW( - hglobInstance, - isDarkMode ? MAKEINTRESOURCE(IDI_TRAY_DARK) - : MAKEINTRESOURCE(IDI_TRAY_BRIGHT)); - if (hTrayIcon_ == nullptr) { - PrintWindowsError(L"LoadIcon"); - } else { - trayIcon_.ChangeIcon(hTrayIcon_); - } - } return 0; } diff --git a/WinMute/WinMute.rc b/WinMute/WinMute.rc index 1d1fb10..0d53f4c 100644 --- a/WinMute/WinMute.rc +++ b/WinMute/WinMute.rc @@ -435,10 +435,6 @@ END // remains consistent on all systems. IDI_APP ICON "icons\\app.ico" -IDI_TRAY_BRIGHT ICON "icons\\tray_bright.ico" - -IDI_TRAY_DARK ICON "icons\\tray_dark.ico" - IDI_SETTINGS ICON "icons\\settings.ico" diff --git a/WinMute/icons/app-512.png b/WinMute/icons/app-512.png new file mode 100644 index 0000000..562a082 Binary files /dev/null and b/WinMute/icons/app-512.png differ diff --git a/WinMute/icons/app.ico b/WinMute/icons/app.ico index bbb5355..6d2d1a2 100644 Binary files a/WinMute/icons/app.ico and b/WinMute/icons/app.ico differ diff --git a/WinMute/icons/app.svg b/WinMute/icons/app.svg new file mode 100644 index 0000000..071d395 --- /dev/null +++ b/WinMute/icons/app.svg @@ -0,0 +1,155 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ! + + diff --git a/WinMute/icons/settings-512.png b/WinMute/icons/settings-512.png new file mode 100644 index 0000000..b9de182 Binary files /dev/null and b/WinMute/icons/settings-512.png differ diff --git a/WinMute/icons/settings.ico b/WinMute/icons/settings.ico index 9118b8f..ce9a127 100644 Binary files a/WinMute/icons/settings.ico and b/WinMute/icons/settings.ico differ diff --git a/WinMute/icons/settings.svg b/WinMute/icons/settings.svg new file mode 100644 index 0000000..55dc5aa --- /dev/null +++ b/WinMute/icons/settings.svg @@ -0,0 +1,55 @@ + + + + + + + + + + + diff --git a/WinMute/icons/tray_bright.ico b/WinMute/icons/tray_bright.ico deleted file mode 100644 index f070e5f..0000000 Binary files a/WinMute/icons/tray_bright.ico and /dev/null differ diff --git a/WinMute/icons/tray_dark.ico b/WinMute/icons/tray_dark.ico deleted file mode 100644 index d3590f9..0000000 Binary files a/WinMute/icons/tray_dark.ico and /dev/null differ diff --git a/WinMute/resource.h b/WinMute/resource.h index 419849b..3a1ea6b 100644 --- a/WinMute/resource.h +++ b/WinMute/resource.h @@ -4,8 +4,6 @@ // #define IDI_APP 5 #define IDD_ABOUT 9 -#define IDI_TRAY_BRIGHT 104 -#define IDI_TRAY_DARK 105 #define IDR_TRAYMENU 106 #define IDD_SETTINGS 109 #define IDD_SETTINGS_GENERAL 114