From fa0610b7f82dde59800353076d39a319203d4f22 Mon Sep 17 00:00:00 2001 From: Antoine Aflalo Date: Thu, 20 Aug 2015 15:45:54 +0300 Subject: [PATCH] Adds a green arrow new to the current DefaultDevice in the TrayList. --- SoundSwitch/Properties/Resources.Designer.cs | 10 ++++++++++ SoundSwitch/Properties/Resources.resx | 3 +++ SoundSwitch/Resources/GreenCheck.png | Bin 0 -> 730 bytes SoundSwitch/SoundSwitch.csproj | 1 + SoundSwitch/Util/ToolStripDeviceItem.cs | 3 ++- SoundSwitch/Util/TrayIcon.cs | 9 ++++++++- 6 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 SoundSwitch/Resources/GreenCheck.png diff --git a/SoundSwitch/Properties/Resources.Designer.cs b/SoundSwitch/Properties/Resources.Designer.cs index 1afaa52f5a..8160d955ee 100644 --- a/SoundSwitch/Properties/Resources.Designer.cs +++ b/SoundSwitch/Properties/Resources.Designer.cs @@ -60,6 +60,16 @@ internal Resources() { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap GreenCheck { + get { + object obj = ResourceManager.GetObject("GreenCheck", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// diff --git a/SoundSwitch/Properties/Resources.resx b/SoundSwitch/Properties/Resources.resx index 5e97c56329..ed3c6dfb7c 100644 --- a/SoundSwitch/Properties/Resources.resx +++ b/SoundSwitch/Properties/Resources.resx @@ -118,6 +118,9 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + ..\Resources\GreenCheck.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\resources\help.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a diff --git a/SoundSwitch/Resources/GreenCheck.png b/SoundSwitch/Resources/GreenCheck.png new file mode 100644 index 0000000000000000000000000000000000000000..d13aa376461be90b9cd1681fbcd7b1e56a214928 GIT binary patch literal 730 zcmV<00ww*4P)TF-0CiPi$N zSc-7qGu&OW*0a~^Xfa>2W!URO;f7x_m~U_~f`!6bjuumjFK$`%nn`O>ueIqU>TnF> ziwkQFTI)G=GG(|A1PdjwNEKf`!3{t^LYf~lVuUH*+uo96;#dVn5sst9M5!^=x3)h< z2`t1nE>t8B*b?k0 zI33ummWndm*itcRJr{>eU*YZu2+}-O?(t`VW3X`RT1Ejblcwh}GhX-nQx|YC4x6&1 zTV}>1;64;Z8ZgGHy>~Tm5NAvgXSs`52oz)e5FZ_?D!bX-_Xu6bnQjv2ik*(}0&P2o z82;bT8QrmQ1s6!O6w}0w?wC!S?N-lBa16DXxZrF>oVBjvOonT5M?WWaHdDmV-0wJb zM_oe6Cjg5H>#B~|uHDg83UWht&f)J3Qc-k|F>^Rbban1J;d-hyu5rgFHMqv$N?eL7 zU9xG9a>qFxN@=){kw{i!mggT1XWID$fw%-Z$MPiL2DwdGuP|60sKd2}?!C~|v<5eY zJlqm1kg(cZxW;1kB4ah1dG5CH_ejCjGkZfX;pSZU?dZC;7S43>6%Z2}I8#|jVdAw3 z>ToLS44>br#oAK1T5!!2HhPY>mn?ZzqeRFj5SPpA9p@JuJ^2-20K++z;+qzFv;Y7A M07*qoM6N<$f?m- + diff --git a/SoundSwitch/Util/ToolStripDeviceItem.cs b/SoundSwitch/Util/ToolStripDeviceItem.cs index 48aa871818..44bbbdb9b7 100644 --- a/SoundSwitch/Util/ToolStripDeviceItem.cs +++ b/SoundSwitch/Util/ToolStripDeviceItem.cs @@ -16,13 +16,14 @@ using System; using System.Windows.Forms; using AudioEndPointControllerWrapper; +using SoundSwitch.Properties; namespace SoundSwitch.Util { internal class ToolStripDeviceItem : ToolStripMenuItem { public ToolStripDeviceItem(EventHandler onClick, AudioDeviceWrapper audioDevice) - : base(audioDevice.FriendlyName, null, onClick) + : base(audioDevice.FriendlyName, audioDevice.IsDefault ? Resources.GreenCheck : null, onClick) { AudioDevice = audioDevice; } diff --git a/SoundSwitch/Util/TrayIcon.cs b/SoundSwitch/Util/TrayIcon.cs index a1be1100f3..76a8f1ba6c 100644 --- a/SoundSwitch/Util/TrayIcon.cs +++ b/SoundSwitch/Util/TrayIcon.cs @@ -93,7 +93,14 @@ private void SetEventHandlers() { _main.ErrorTriggered += (sender, exception) => ShowError(exception.Exception.Message); _main.AudioDeviceChanged += - (sender, audioDeviceWrapper) => ShowAudioChanged(audioDeviceWrapper.AudioDevice.FriendlyName); + (sender, audioDeviceWrapper) => + { + ShowAudioChanged(audioDeviceWrapper.AudioDevice.FriendlyName); + foreach (ToolStripDeviceItem item in _selectionMenu.Items) + { + item.Image = item.AudioDevice.FriendlyName == audioDeviceWrapper.AudioDevice.FriendlyName ? Resources.GreenCheck : null; + } + }; _main.SelectedDeviceChanged += (sender, changed) => { UpdateAvailableDeviceList();