]> repos.lx-s.de Git - winmute.git/commitdiff
Tried to rework icons a bit
authorlx-s <lx-s@users.noreply.github.com>
Sat, 16 Dec 2023 23:02:04 +0000 (00:02 +0100)
committerlx-s <lx-s@users.noreply.github.com>
Sat, 16 Dec 2023 23:02:04 +0000 (00:02 +0100)
WinMute/WinMute.cpp
WinMute/WinMute.rc
WinMute/icons/app-512.png [new file with mode: 0644]
WinMute/icons/app.ico
WinMute/icons/app.svg [new file with mode: 0644]
WinMute/icons/settings-512.png [new file with mode: 0644]
WinMute/icons/settings.ico
WinMute/icons/settings.svg [new file with mode: 0644]
WinMute/icons/tray_bright.ico [deleted file]
WinMute/icons/tray_dark.ico [deleted file]
WinMute/resource.h

index b5e79b02c1c3a426c6cd23e0c18d3070418729ea..8b7a5d4b3266062ea66064814f5094acafb76e52 100644 (file)
@@ -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<LPBYTE>(&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<const wchar_t *>(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;
 }
 
index 1d1fb1012b470c26c801b1176808555a555a1c2f..0d53f4cbd979c53ad1a478e9de0d29bb9e3b161f 100644 (file)
@@ -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 (file)
index 0000000..562a082
Binary files /dev/null and b/WinMute/icons/app-512.png differ
index bbb5355d0795e9ef6095c1490b080257d27c5000..6d2d1a2800d6f332df25fdfdc4a8cef363befd1b 100644 (file)
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 (file)
index 0000000..071d395
--- /dev/null
@@ -0,0 +1,155 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   width="512"
+   height="512"
+   viewBox="0 0 512 512"
+   version="1.1"
+   id="svg1"
+   inkscape:version="1.3.2 (091e20e, 2023-11-25, custom)"
+   sodipodi:docname="app.svg"
+   inkscape:export-filename="app-512.png"
+   inkscape:export-xdpi="96"
+   inkscape:export-ydpi="96"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:svg="http://www.w3.org/2000/svg">
+  <sodipodi:namedview
+     id="namedview1"
+     pagecolor="#505050"
+     bordercolor="#ffffff"
+     borderopacity="1"
+     inkscape:showpageshadow="0"
+     inkscape:pageopacity="0"
+     inkscape:pagecheckerboard="1"
+     inkscape:deskcolor="#505050"
+     inkscape:document-units="px"
+     showguides="true"
+     inkscape:zoom="1.1228082"
+     inkscape:cx="18.257793"
+     inkscape:cy="217.75758"
+     inkscape:window-width="2560"
+     inkscape:window-height="1009"
+     inkscape:window-x="-8"
+     inkscape:window-y="-8"
+     inkscape:window-maximized="1"
+     inkscape:current-layer="layer1">
+    <sodipodi:guide
+       position="-301.02829,261.98278"
+       orientation="0,-1"
+       id="guide8"
+       inkscape:locked="false" />
+    <sodipodi:guide
+       position="-304.59342,361.48454"
+       orientation="0,-1"
+       id="guide9"
+       inkscape:locked="false" />
+    <sodipodi:guide
+       position="-363.37461,162.87538"
+       orientation="0,-1"
+       id="guide10"
+       inkscape:locked="false" />
+    <sodipodi:guide
+       position="-244.92161,460.34381"
+       orientation="0,-1"
+       id="guide11"
+       inkscape:locked="false" />
+    <sodipodi:guide
+       position="-272.53096,62.23486"
+       orientation="0,-1"
+       id="guide12"
+       inkscape:locked="false" />
+    <sodipodi:guide
+       position="50.76557,477.26566"
+       orientation="1,0"
+       id="guide13"
+       inkscape:locked="false" />
+    <sodipodi:guide
+       position="362.48398,358.81267"
+       orientation="1,0"
+       id="guide14"
+       inkscape:locked="false" />
+    <sodipodi:guide
+       position="224.43726,374.8439"
+       orientation="1,0"
+       id="guide15"
+       inkscape:locked="false" />
+    <sodipodi:guide
+       position="314.25338,449.02337"
+       orientation="1,0"
+       id="guide16"
+       inkscape:locked="false" />
+    <sodipodi:guide
+       position="137.1561,394.43763"
+       orientation="1,0"
+       id="guide17"
+       inkscape:locked="false" />
+    <sodipodi:guide
+       position="98.243542,394.2337"
+       orientation="1,0"
+       id="guide18"
+       inkscape:locked="false" />
+    <sodipodi:guide
+       position="299.13899,400.53137"
+       orientation="1,0"
+       id="guide19"
+       inkscape:locked="false" />
+  </sodipodi:namedview>
+  <defs
+     id="defs1">
+    <rect
+       x="391.87458"
+       y="40.968706"
+       width="56.109314"
+       height="357.14024"
+       id="rect26" />
+    <linearGradient
+       id="swatch22">
+      <stop
+         style="stop-color:#000000;stop-opacity:1;"
+         offset="0.45652175"
+         id="stop22" />
+    </linearGradient>
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#swatch22"
+       id="radialGradient22"
+       cx="206.62624"
+       cy="250.03953"
+       fx="206.62624"
+       fy="250.03953"
+       r="156.80599"
+       gradientTransform="matrix(0.99619803,0,0,1.5243246,0.34028102,-119.52623)"
+       gradientUnits="userSpaceOnUse" />
+  </defs>
+  <g
+     inkscape:label="Ebene 1"
+     inkscape:groupmode="layer"
+     id="layer1">
+    <path
+       d="m 298.6558,51.763601 -159.39296,100.351939 -89.814619,0.60253 0.728548,195.59663 88.693091,1.65266 158.8987,122.40086 z"
+       style="display:inline;fill:url(#radialGradient22);stroke:#e7e7e7;stroke-width:3.14458;stroke-linecap:round;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1;paint-order:markers fill stroke"
+       id="path26"
+       sodipodi:nodetypes="ccccccc" />
+    <path
+       style="display:inline;fill:#132e3f;fill-opacity:1;stroke:#c0ccf8;stroke-width:3.48859;stroke-dasharray:none;stroke-opacity:1"
+       d="M 447.89768,421.69014 C 235.70893,209.26395 63.39014,45.098196 65.227745,44.931141 L 43.147019,66.306118 421.91096,445.64954 Z"
+       id="path19"
+       inkscape:label="slash"
+       sodipodi:nodetypes="ccccc" />
+    <text
+       xml:space="preserve"
+       id="text26"
+       style="font-size:43.5785px;white-space:pre;shape-inside:url(#rect26);display:inline;fill:#122e3f;fill-opacity:1;stroke:#ffffff;stroke-width:0.181478;stroke-linecap:round;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1;paint-order:markers fill stroke"
+       inkscape:label="Exclamation Mark"
+       transform="matrix(6.992757,0,0,6.7710102,-2420.2895,-308.68022)"><tspan
+         x="391.875"
+         y="81.20562"
+         id="tspan2"><tspan
+           style="font-family:'Cascadia Code';-inkscape-font-specification:'Cascadia Code'"
+           id="tspan1">!</tspan></tspan></text>
+  </g>
+</svg>
diff --git a/WinMute/icons/settings-512.png b/WinMute/icons/settings-512.png
new file mode 100644 (file)
index 0000000..b9de182
Binary files /dev/null and b/WinMute/icons/settings-512.png differ
index 9118b8f127de5cd8624e488ad0465419ab3b5cea..ce9a12744fcc2de6410afbcfc90951bc9398e8d4 100644 (file)
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 (file)
index 0000000..55dc5aa
--- /dev/null
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   width="512"
+   height="512"
+   viewBox="0 0 512 512"
+   version="1.1"
+   id="svg1"
+   inkscape:version="1.3.2 (091e20e, 2023-11-25, custom)"
+   sodipodi:docname="settings.svg"
+   inkscape:export-filename="settings-512.png"
+   inkscape:export-xdpi="96"
+   inkscape:export-ydpi="96"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:svg="http://www.w3.org/2000/svg">
+  <sodipodi:namedview
+     id="namedview1"
+     pagecolor="#505050"
+     bordercolor="#ffffff"
+     borderopacity="1"
+     inkscape:showpageshadow="0"
+     inkscape:pageopacity="0"
+     inkscape:pagecheckerboard="1"
+     inkscape:deskcolor="#505050"
+     inkscape:document-units="px"
+     inkscape:zoom="1.5878906"
+     inkscape:cx="255.68512"
+     inkscape:cy="256"
+     inkscape:window-width="2560"
+     inkscape:window-height="1009"
+     inkscape:window-x="-8"
+     inkscape:window-y="-8"
+     inkscape:window-maximized="1"
+     inkscape:current-layer="svg1"
+     showgrid="false" />
+  <defs
+     id="defs1" />
+  <g
+     inkscape:label="Ebene 1"
+     inkscape:groupmode="layer"
+     id="layer1" />
+  <g
+     inkscape:label="Rendered Gears"
+     transform="translate(255.685, 256)"
+     id="g25"
+     style="stroke:#494949;stroke-opacity:1;stroke-width:10;stroke-dasharray:none;stroke-linejoin:round;fill:#ffffff;fill-opacity:0.99640286">
+    <path
+       id="path24"
+       style="fill:#ffffff;stroke:#494949;stroke-width:10;stroke-opacity:1;stroke-dasharray:none;stroke-linejoin:round;fill-opacity:0.99640286"
+       d="M -14.118594 -222.36914 L -24.929141 -189.35156 L -24.884219 -186.43164 L -21.056094 -157.75586 L -60.642031 -147.14844 L -71.665469 -173.89648 L -73.087344 -176.44727 L -98.958438 -199.63672 L -123.41156 -185.51758 L -116.26508 -151.51953 L -114.76508 -149.01172 L -97.114688 -126.0918 L -126.09125 -97.113281 L -149.01117 -114.76562 L -151.51898 -116.26562 L -185.51703 -123.41016 L -199.63617 -98.957031 L -176.44867 -73.087891 L -173.89594 -71.664062 L -147.14984 -60.642578 L -157.75531 -21.056641 L -186.43109 -24.884766 L -189.35297 -24.927734 L -222.36859 -14.119141 L -222.36859 14.119141 L -189.35297 24.927734 L -186.43109 24.884766 L -157.75531 21.056641 L -147.14984 60.642578 L -173.89594 71.664062 L -176.44867 73.087891 L -199.63617 98.957031 L -185.51703 123.41016 L -151.51898 116.26562 L -149.01117 114.76562 L -126.09125 97.113281 L -97.114688 126.0918 L -114.76508 149.01172 L -116.26508 151.51953 L -123.41156 185.51758 L -98.958438 199.63672 L -73.087344 176.44727 L -71.665469 173.89648 L -60.642031 147.14844 L -21.056094 157.75586 L -24.884219 186.43164 L -24.929141 189.35156 L -14.118594 222.36914 L 14.117734 222.36914 L 24.928281 189.35156 L 24.885312 186.43164 L 21.057187 157.75586 L 60.641172 147.14844 L 71.664609 173.89648 L 73.086484 176.44727 L 98.957578 199.63672 L 123.4107 185.51758 L 116.26422 151.51953 L 114.76617 149.01172 L 97.113828 126.0918 L 126.09234 97.113281 L 149.01227 114.76562 L 151.51812 116.26562 L 185.51812 123.41016 L 199.63727 98.957031 L 176.44781 73.087891 L 173.89508 71.664062 L 147.14898 60.642578 L 157.75641 21.056641 L 186.43023 24.884766 L 189.35211 24.927734 L 222.36969 14.119141 L 222.36969 -14.119141 L 189.35211 -24.927734 L 186.43023 -24.884766 L 157.75641 -21.056641 L 147.14898 -60.642578 L 173.89508 -71.664062 L 176.44781 -73.087891 L 199.63727 -98.957031 L 185.51812 -123.41016 L 151.51812 -116.26562 L 149.01227 -114.76562 L 126.09234 -97.113281 L 97.113828 -126.0918 L 114.76617 -149.01172 L 116.26422 -151.51953 L 123.4107 -185.51758 L 98.957578 -199.63672 L 73.086484 -176.44727 L 71.664609 -173.89648 L 60.641172 -147.14844 L 21.057187 -157.75586 L 24.885312 -186.43164 L 24.928281 -189.35156 L 14.117734 -222.36914 L -14.118594 -222.36914 z M 0.000546875 -75 A 75 75 0 0 1 75.000547 0 A 75 75 0 0 1 0.000546875 75 A 75 75 0 0 1 -74.999453 0 A 75 75 0 0 1 0.000546875 -75 z " />
+  </g>
+</svg>
diff --git a/WinMute/icons/tray_bright.ico b/WinMute/icons/tray_bright.ico
deleted file mode 100644 (file)
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 (file)
index d3590f9..0000000
Binary files a/WinMute/icons/tray_dark.ico and /dev/null differ
index 419849b136ae756c53b1fbd35e2489db70243747..3a1ea6b61378b4ac324567f526e8ecc1ce446919 100644 (file)
@@ -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