Skip to content

Commit

Permalink
boost(Profile::QuickMenu): Only display quick menu when selected in t…
Browse files Browse the repository at this point in the history
…he global setting when switching between profiles.

Fixes #745
  • Loading branch information
Belphemur committed Sep 11, 2021
1 parent 2ab20ea commit 1e034ae
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions SoundSwitch/Framework/Profile/Hotkey/ProfileHotkeyManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using JetBrains.Annotations;
using SoundSwitch.Framework.WinApi;
using SoundSwitch.Framework.WinApi.Keyboard;
using SoundSwitch.Model;
using SoundSwitch.UI.Menu;
using SoundSwitch.UI.Menu.Component;

Expand Down Expand Up @@ -54,11 +55,14 @@ private void WindowsAPIAdapterOnHotKeyPressed(object? sender, WindowsAPIAdapter.
_profileManager.SwitchAudio(nextProfile);
hotKeysSelection.LastUsed = nextProfile;

QuickMenuManager<Profile>.Instance.DisplayMenu(hotKeysSelection.Profiles.Select(profile => new HotKeyItem(nextProfile == profile, profile)), @event =>
if (AppModel.Instance.QuickMenuEnabled)
{
hotKeysSelection.LastUsed = @event.Item.Payload;
_profileManager.SwitchAudio(@event.Item.Payload);
});
QuickMenuManager<Profile>.Instance.DisplayMenu(hotKeysSelection.Profiles.Select(profile => new HotKeyItem(nextProfile == profile, profile)), @event =>
{
hotKeysSelection.LastUsed = @event.Item.Payload;
_profileManager.SwitchAudio(@event.Item.Payload);
});
}
}

/// <summary>
Expand Down

0 comments on commit 1e034ae

Please sign in to comment.